These are chat archives for hibernate/hibernate-orm

Mar 2017
Mar 10 2017 12:52
hi i didnt understant what is wrong :/
ı think my HQL is correct
Mar 10 2017 13:56
The last line of your hql should be a where
Mar 10 2017 14:17
@ryan2049 thank you ı confused ı corrected but ı am getting still exception that is org.hibernate.exception.SQLGrammarException: could not execute statement
so i will write another hql it seems so complex
Iwan Aucamp
Mar 10 2017 14:30
@bilgeebilgin can you paste directly instead of screenshot ? Also I'm not sure what you want SELECT COUNT(*)>0 to do but I don't think that will work
you should use having COUNT(*)>0
List<Object[]> personTotalCallDurations = entityManager.createQuery(
    "select, sum( c.duration ) " +
    "from Call c " +
    "join ph " +
    "join ph.person p " +
    "group by " +
    "having sum( c.duration ) > 1000", Object[].class )
so just switch out sum for count
Iwan Aucamp
Mar 10 2017 14:37
@bilgeebilgin also - if possible share your schema - and I think you will need to do a join to do something like this:
Mar 10 2017 14:41
@aucampia now ı dont have time but i will share later thank you for your interest :)