Hey,
I would like to check, how many unread messages an user has.
I have two tables, Users and Messages, User has a one to many mapping to Messages.
Alright not to check how many unread messages an User has i do the following HQL:
Code:
hql="select count(usr.messages) from Users usr where usr.username = :username and usr.messages.read=0";
but that doesnt work :(
Do you have an Idea how i could solve my problem (even if there is no such user it should return a number - 0 in that case)
Thanx for reading,
virtually yours