db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Criteria#addIdentityEqualTo
Date Wed, 15 Sep 2004 18:26:07 GMT
hi all,

i added a new feature (required for jdo) to support an identity criterion:

         Person p = new Person();
         p.setId(1);
         p.setFirstname("tom");
         Identity id = broker.serviceIdentity().buildIdentity(p);

         Criteria crit = new Criteria();
         crit.addIdentityEqualTo("persons", id);  <<<<<<<

	// translates to crit.addEqualTo("persons.id", new Integer(1));

         Query q = QueryFactory.newQuery(Project.class, crit);
         Collection results = broker.getCollectionByQuery(q);

the method addIdentityEqualTo() allows you to compare an identity instead of 
using single attributes. the identity is translated during sql generation and 
binding.

jakob

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message