You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thimo König <th...@armax.de> on 2003/05/02 16:03:12 UTC

Criteria with an Object

Hi,

I have two classes:

o Document
o User

For each document there is a user assigned as creator of the document.
Now I want to do a query where i get all documents which have been
created by a certain user. The Criteria should look something like this:

criteria.addEqualTo("creator", currentUser);
Query q = QueryFactory.newQuery(Document.class, criteria);

Unfortunately this doesn't work. Why?

I hope I don't have to do something like this:
criteria.addEqualTo("creator.OID", currentUser.getOID());


Thanks
Thimo