With JPQL, it helps to think about classes and fields, rather than
tables and columns. The query layer knows only about the fields and
relationships you defined in your class, e,g,:

clas ChatUserLoggedIn {
    ...
    private ChatRoom room;
    ...
}

but not the column that represents the association between
ChatUserLoggedIn and ChatRoom in your database schema ((chatroomid).

So, the query needs to check the room field:

"SELECT u FROM ChatUserLoggedIn u WHERE u.room IS NULL"

JPQL will do an implicit outer join for you between ChatUserLoggedIn
and ChatRoom.

Not sure how it worked in the JBoss environment, because the original
query has an equality comparision for null ("...where u.chatroomid =
null"), which is undefined.

Thanks
Dinkar

Reply via email to