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

Quick Search    Search Deep

org.apache.ojb.broker.query
Interface Query  view Query download Query.java

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
QueryByCriteria, QueryByIdentity, QueryBySQL

public interface Query
extends java.io.Serializable

represents Queries that can be used by the OJB PersistenceBroker to retrieve Objects from the underlying DB. Until now there are two implementations: 1. QueryByCriteria, represents SELECT * FROM ... WHERE ... queries 2. QueryByIdentity, uses Example objects or OIDs as templates for the db lookup there could additional implementations, e.g for user defined SQL For the Criteria API I reused code from the COBRA project, as you will see by their class comments. I removed all stuff that relies on knowlegde of the DataDictionary or MetaData layer. The Query and Criteria classes thus don't know how to build SQL statements, as in the COBRA original sources. I use the this classes as mere data-structures, that are processed by the OJB Accesslayer (SqlGenerator, JdbcAccess). This design will allow to reuse the org.apache.ojb.broker.query package in other projects without breaking any references. I hope this will be useful for someone.


Field Summary
static int NO_END_AT_INDEX
           
static int NO_START_AT_INDEX
           
static boolean NOT_SCROLLABLE
           
static boolean SCROLLABLE
           
 
Method Summary
 int fullSize()
           
 void fullSize(int size)
           
 Criteria getCriteria()
          return the criteria of the query if present or null.
 int getEndAtIndex()
           
 java.lang.Object getExampleObject()
          return the template Object if present or null
 java.lang.Class getSearchClass()
          return the target class, representing the extend to be searched
 int getStartAtIndex()
           
 boolean isDistinct()
          return true if select DISTINCT should be used
 void setEndAtIndex(int endAtIndex)
          Set the row at which the query should stop retieving results, exlusive.
 void setStartAtIndex(int startAtIndex)
          Set the row at which the query should start retrieving results, inclusive.
 

Field Detail

NO_START_AT_INDEX

public static final int NO_START_AT_INDEX
See Also:
Constant Field Values

NO_END_AT_INDEX

public static final int NO_END_AT_INDEX
See Also:
Constant Field Values

SCROLLABLE

public static final boolean SCROLLABLE
See Also:
Constant Field Values

NOT_SCROLLABLE

public static final boolean NOT_SCROLLABLE
See Also:
Constant Field Values
Method Detail

getCriteria

public Criteria getCriteria()
return the criteria of the query if present or null.


getExampleObject

public java.lang.Object getExampleObject()
return the template Object if present or null


getSearchClass

public java.lang.Class getSearchClass()
return the target class, representing the extend to be searched


isDistinct

public boolean isDistinct()
return true if select DISTINCT should be used


getStartAtIndex

public int getStartAtIndex()

setStartAtIndex

public void setStartAtIndex(int startAtIndex)
Set the row at which the query should start retrieving results, inclusive.


getEndAtIndex

public int getEndAtIndex()

setEndAtIndex

public void setEndAtIndex(int endAtIndex)
Set the row at which the query should stop retieving results, exlusive.


fullSize

public void fullSize(int size)

fullSize

public int fullSize()