“Hibernate Select Count” Réponses codées

Hibernate Select Count

// All entries
Long count = (Long) session.createQuery("select count(ALL YourTable) from YourTable yourTable").getSingleResult();

// filtered entries
Long count = (Long) session.createQuery("select count(yourTable) from YourTable yourTable where yourTable.whatever = whatever").setParameter("whatever", yourParam).getSingleResult();
Zwazel

Hibernate Select Count


Query query = session.createQuery(
        "select count(*) from LoginClass login where login.emailid=:email and login.password=:password");
query.setString("email", "something");
query.setString("password", "password");
Long count = (Long)query.uniqueResult();

Clever Capybara

Réponses similaires à “Hibernate Select Count”

Questions similaires à “Hibernate Select Count”

Plus de réponses similaires à “Hibernate Select Count” dans Java

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code