“Hibernate Select Count” Code-Antworten

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

Ähnliche Antworten wie “Hibernate Select Count”

Fragen ähnlich wie “Hibernate Select Count”

Weitere verwandte Antworten zu “Hibernate Select Count” auf Java

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen