Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.broker.query
Class QueryByExample  view QueryByExample download QueryByExample.java

java.lang.Object
  extended byojb.broker.query.QueryByExample
All Implemented Interfaces:
Query, java.io.Serializable

public class QueryByExample
extends java.lang.Object
implements Query

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);


Field Summary
private  java.lang.Object exampleObject
           
 
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
 

Field Detail

exampleObject

private java.lang.Object exampleObject
Constructor Detail

QueryByExample

public QueryByExample(java.lang.Object example_or_identity)
QueryByExample can be generated from example Objects or by Identity Objects

Method Detail

getCriteria

public Criteria getCriteria()
Method declaration

Specified by:
getCriteria in interface Query

getExampleObject

public java.lang.Object getExampleObject()
Method declaration

Specified by:
getExampleObject in interface Query

getSearchClass

public java.lang.Class getSearchClass()
Method declaration

Specified by:
getSearchClass in interface Query

isDistinct

public boolean isDistinct()
Description copied from interface: Query
return true if select DISTINCT should be used

Specified by:
isDistinct in interface Query