openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsmch <js...@web.de>
Subject Re: Problems with openjpa on foreign keys (says "no field named in class")
Date Sat, 08 Nov 2008 15:51:17 GMT

Thanks - that helped.
Obviosly the person who coded the original source did not use standards (but
i thought so).

Now that i use object-parameters it works very fine.


Dinkar Rao wrote:
> 
> 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
> 
> 

-- 
View this message in context: http://n2.nabble.com/Problems-with-openjpa-on-foreign-keys-%28says-%22no-field-named-in-class%22%29-tp1441729p1473916.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message