org.objectweb.speedo.query.jdo
Class JDOQueryDefinitionImpl

java.lang.Object
  extended by org.objectweb.speedo.query.jdo.JDOQueryDefinitionImpl
All Implemented Interfaces:
QueryDefinition
Direct Known Subclasses:
JDOQuery

public class JDOQueryDefinitionImpl
extends java.lang.Object
implements QueryDefinition

is a basic implementation of the QueryDefinition interface.

Author:
S.Chassande-Barrioz

Field Summary
protected  java.lang.Class candidateClass
          Class of candadate classes.
protected  java.util.Collection candidateInstances
          Candidate classes or extent for the query.
protected  Extent extentClass
           
protected  boolean fetchIdentifierOnly
           
protected  java.lang.String filter
          Query filter.
protected  java.lang.String grouping
           
protected  boolean ignoreCache
          IgnoreCache option.
protected  java.util.List importStatements
          the import statements is transformed into a simple vector
protected  long indexFirst
           
protected  long indexLast
           
protected  java.util.List order
           
protected  java.lang.String parameters
          Query parameters and variables declaration
protected  java.lang.String result
           
protected  java.lang.Class resultClass
           
protected  short type
           
protected  boolean unique
           
protected  java.lang.String variables
           
protected  boolean withPrefetch
           
 
Fields inherited from interface org.objectweb.speedo.query.api.QueryDefinition
TYPE_DELETE, TYPE_SELECT, TYPE_UPDATE
 
Constructor Summary
JDOQueryDefinitionImpl()
           
JDOQueryDefinitionImpl(JDOQueryDefinitionImpl qd)
           
 
Method Summary
 void defineWith(JDOQueryDefinitionImpl qd)
           
 boolean equals(java.lang.Object obj)
           
 boolean fetchIdentifierOnly()
           
 java.lang.Class getCandidateClass()
           
 java.util.Collection getCollection()
           
 Extent getExtent()
           
 java.lang.String getFilter()
           
 java.lang.String getGrouping()
           
 java.util.List getImportStatements()
           
 boolean getIncludeSubClasses()
           
 long getIndexFirst()
          The application may want to skip some number of results that may have been previously returned, and additionally may want to limit the number of instances returned from a query.
 long getIndexLast()
          The application may want to skip some number of results that may have been previously returned, and additionally may want to limit the number of instances returned from a query.
 java.util.List getOrder()
           
 java.lang.String getParameters()
           
 short getQueryType()
           
 java.lang.String getResult()
           
 java.lang.Class getResultClass()
           
 boolean getUnique()
           
 java.lang.String getVariables()
           
 int hashCode()
           
 boolean isCollection()
           
 boolean isIgnoreCache()
           
 java.lang.String qdToString(boolean oneLine)
           
static java.lang.String queryType2string(short type)
           
 java.lang.String toString()
           
 boolean withPrefetch()
           
 void withPrefetch(boolean withPrefetch)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected short type

ignoreCache

protected boolean ignoreCache
IgnoreCache option. The ignoreCache option setting specifies whether the query should execute entirely in the back end, instead of in the cache. If this flag is set to true, an implementation might be able to optimize the query execution by ignoring changed values in the cache. For optimistic transactions, this can dramatically improve query response times.


candidateInstances

protected java.util.Collection candidateInstances
Candidate classes or extent for the query.


extentClass

protected Extent extentClass

candidateClass

protected java.lang.Class candidateClass
Class of candadate classes.


filter

protected java.lang.String filter
Query filter.


parameters

protected java.lang.String parameters
Query parameters and variables declaration


variables

protected java.lang.String variables

importStatements

protected java.util.List importStatements
the import statements is transformed into a simple vector


order

protected java.util.List order

indexFirst

protected transient long indexFirst

indexLast

protected transient long indexLast

unique

protected boolean unique

result

protected java.lang.String result

resultClass

protected java.lang.Class resultClass

withPrefetch

protected boolean withPrefetch

grouping

protected java.lang.String grouping

fetchIdentifierOnly

protected boolean fetchIdentifierOnly
Constructor Detail

JDOQueryDefinitionImpl

public JDOQueryDefinitionImpl()

JDOQueryDefinitionImpl

public JDOQueryDefinitionImpl(JDOQueryDefinitionImpl qd)
Method Detail

queryType2string

public static java.lang.String queryType2string(short type)

defineWith

public void defineWith(JDOQueryDefinitionImpl qd)

fetchIdentifierOnly

public boolean fetchIdentifierOnly()
Specified by:
fetchIdentifierOnly in interface QueryDefinition

getQueryType

public short getQueryType()
Specified by:
getQueryType in interface QueryDefinition

getCandidateClass

public java.lang.Class getCandidateClass()

isCollection

public boolean isCollection()

getCollection

public java.util.Collection getCollection()

getParameters

public java.lang.String getParameters()

getVariables

public java.lang.String getVariables()

getFilter

public java.lang.String getFilter()

getExtent

public Extent getExtent()

getImportStatements

public java.util.List getImportStatements()

isIgnoreCache

public boolean isIgnoreCache()

getOrder

public java.util.List getOrder()

getIndexFirst

public long getIndexFirst()
Description copied from interface: QueryDefinition
The application may want to skip some number of results that may have been previously returned, and additionally may want to limit the number of instances returned from a query. The default range for query execution if this method is not called are (0, Long.MAX_VALUE).

Specified by:
getIndexFirst in interface QueryDefinition

getIndexLast

public long getIndexLast()
Description copied from interface: QueryDefinition
The application may want to skip some number of results that may have been previously returned, and additionally may want to limit the number of instances returned from a query. The default range for query execution if this method is not called are (0, Long.MAX_VALUE).

Specified by:
getIndexLast in interface QueryDefinition

getUnique

public boolean getUnique()

getResult

public java.lang.String getResult()

getResultClass

public java.lang.Class getResultClass()

getIncludeSubClasses

public boolean getIncludeSubClasses()

getGrouping

public java.lang.String getGrouping()

withPrefetch

public boolean withPrefetch()
Specified by:
withPrefetch in interface QueryDefinition

withPrefetch

public void withPrefetch(boolean withPrefetch)
Specified by:
withPrefetch in interface QueryDefinition

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

qdToString

public java.lang.String qdToString(boolean oneLine)
Specified by:
qdToString in interface QueryDefinition

hashCode

public int hashCode()
Specified by:
hashCode in interface QueryDefinition
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface QueryDefinition
Overrides:
equals in class java.lang.Object