|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.broker.query.QueryByExample
represents a search by example. "find the article with id 7" could be represented as: Article example = new Article(); example.setId(7); Query qry = new QueryByExample(example); The PersistenceBroker can retrieve Objects by examples as follows: PersistenceBroker broker = PersistenceBrokerFactory.createPersistenceBroker(); Collection col = broker.getObjectByQuery(qry); This Class can also handle working with OJB Identity objects: "find the article with Identity xyz" could be represnted as Identity xyz = new Identity(example); Query qry = new QueryByExample(xyz);
Constructor Summary | |
QueryByExample(java.lang.Object example_or_identity)
QueryByExample can be generated from example Objects or by Identity Objects |
Method Summary | |
Criteria |
getCriteria()
Method declaration |
java.lang.Object |
getExampleObject()
Method declaration |
java.lang.Class |
getSearchClass()
Method declaration |
boolean |
isDistinct()
return true if select DISTINCT should be used |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QueryByExample(java.lang.Object example_or_identity)
Method Detail |
public Criteria getCriteria()
getCriteria
in interface Query
public java.lang.Object getExampleObject()
getExampleObject
in interface Query
public java.lang.Class getSearchClass()
getSearchClass
in interface Query
public boolean isDistinct()
Query
isDistinct
in interface Query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |