org.neodatis.odb.core.query
Class AbstractQuery

java.lang.Object
  extended by org.neodatis.odb.core.query.AbstractQuery
All Implemented Interfaces:
java.io.Serializable, IQuery
Direct Known Subclasses:
CriteriaQuery, NativeQuery, SimpleNativeQuery

public abstract class AbstractQuery
extends java.lang.Object
implements IQuery

See Also:
Serialized Form

Field Summary
protected  IQueryExecutionPlan executionPlan
           
protected  OID oidOfObjectToQuery
          The OID attribute is used when the query must be restricted the object with this OID
protected  java.lang.String[] orderByFields
           
protected  OrderByConstants orderByType
           
protected  boolean polymorphic
           
protected  IStorageEngine storageEngine
           
 
Constructor Summary
AbstractQuery()
           
 
Method Summary
 IQueryExecutionPlan getExecutionPlan()
           
 OID getOidOfObjectToQuery()
          used with isForSingleOid == true, to indicate we are working on a single object with a specific oid
 java.lang.String[] getOrderByFieldNames()
          Returns the field names of the order by
 OrderByConstants getOrderByType()
           
 IStorageEngine getStorageEngine()
           
 boolean hasOrderBy()
          Returns true if the query has an order by clause
 boolean isForSingleOid()
          Returns true is query must apply on a single object OID
 boolean isPolymorphic()
           
 boolean optimizeObjectComparison()
           
 IQuery orderByAsc(java.lang.String fields)
          To order by the result of a query in ascendent order
 IQuery orderByDesc(java.lang.String fields)
          To order by the result of a query in descendent order
 void setExecutionPlan(IQueryExecutionPlan plan)
           
 void setOidOfObjectToQuery(OID oidOfObjectToQuery)
           
 IQuery setOptimizeObjectComparison(boolean yesNo)
           
 void setOrderByFields(java.lang.String[] orderByFields)
           
 void setOrderByType(OrderByConstants orderByType)
           
 IQuery setPolymorphic(boolean yes)
          To specify that instances of subclass of the query class must not be load if true, when querying objects of class Class1, only direct instances of Class1 will be loaded.
 void setStorageEngine(IStorageEngine storageEngine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orderByFields

protected java.lang.String[] orderByFields

orderByType

protected OrderByConstants orderByType

storageEngine

protected transient IStorageEngine storageEngine

executionPlan

protected IQueryExecutionPlan executionPlan

polymorphic

protected boolean polymorphic

oidOfObjectToQuery

protected OID oidOfObjectToQuery
The OID attribute is used when the query must be restricted the object with this OID

Constructor Detail

AbstractQuery

public AbstractQuery()
Method Detail

orderByDesc

public IQuery orderByDesc(java.lang.String fields)
Description copied from interface: IQuery
To order by the result of a query in descendent order

Specified by:
orderByDesc in interface IQuery
Parameters:
fields - A comma separated field list
Returns:
this

orderByAsc

public IQuery orderByAsc(java.lang.String fields)
Description copied from interface: IQuery
To order by the result of a query in ascendent order

Specified by:
orderByAsc in interface IQuery
Parameters:
fields - A comma separated field list
Returns:
this

getOrderByFieldNames

public java.lang.String[] getOrderByFieldNames()
Description copied from interface: IQuery
Returns the field names of the order by

Specified by:
getOrderByFieldNames in interface IQuery
Returns:
The array of fields of the order by

setOrderByFields

public void setOrderByFields(java.lang.String[] orderByFields)

getOrderByType

public OrderByConstants getOrderByType()
Specified by:
getOrderByType in interface IQuery
Returns:
the type of the order by - ORDER_BY_NONE,ORDER_BY_DESC,ORDER_BY_ASC

setOrderByType

public void setOrderByType(OrderByConstants orderByType)

hasOrderBy

public boolean hasOrderBy()
Description copied from interface: IQuery
Returns true if the query has an order by clause

Specified by:
hasOrderBy in interface IQuery
Returns:
true if has an order by flag

getStorageEngine

public IStorageEngine getStorageEngine()
Specified by:
getStorageEngine in interface IQuery

setStorageEngine

public void setStorageEngine(IStorageEngine storageEngine)
Specified by:
setStorageEngine in interface IQuery

getExecutionPlan

public IQueryExecutionPlan getExecutionPlan()
Specified by:
getExecutionPlan in interface IQuery

setExecutionPlan

public void setExecutionPlan(IQueryExecutionPlan plan)
Specified by:
setExecutionPlan in interface IQuery

isPolymorphic

public boolean isPolymorphic()
Specified by:
isPolymorphic in interface IQuery

setPolymorphic

public IQuery setPolymorphic(boolean yes)
Description copied from interface: IQuery
To specify that instances of subclass of the query class must not be load if true, when querying objects of class Class1, only direct instances of Class1 will be loaded. If false, when querying objects of class Class1, direct instances of Class1 will be loaded and all instances of subclasses of Class1.

Specified by:
setPolymorphic in interface IQuery

getOidOfObjectToQuery

public OID getOidOfObjectToQuery()
Description copied from interface: IQuery
used with isForSingleOid == true, to indicate we are working on a single object with a specific oid

Specified by:
getOidOfObjectToQuery in interface IQuery
Returns:

setOidOfObjectToQuery

public void setOidOfObjectToQuery(OID oidOfObjectToQuery)

isForSingleOid

public boolean isForSingleOid()
Returns true is query must apply on a single object OID

Specified by:
isForSingleOid in interface IQuery
Returns:

optimizeObjectComparison

public boolean optimizeObjectComparison()
Specified by:
optimizeObjectComparison in interface IQuery
Returns:

setOptimizeObjectComparison

public IQuery setOptimizeObjectComparison(boolean yesNo)
Specified by:
setOptimizeObjectComparison in interface IQuery