com.sybase.persistence
Class Query

java.lang.Object
  extended by com.sybase.persistence.Query

public class Query
extends java.lang.Object

Programmatic interface to Query objects. A Query is an object representation of a dynamic query. In contrast to named queries with fixed SQL, a dynamic query allows the caller to choose the MBO table to query, the columns selected, test criteria, and sort order. To support this, MBOs must be generated with metadata or with the "Allow dynamic queries" option selected. MBOs that support dynamic queries will have a method ObjectList.findWithQuery: that returns a list of MBO objects for the query. The database class for a package has the method QueryResultSet.executeQuery: that returns a result set that includes only data for the particular columns selected. When the executeQuery method is used, the Query class supports joins between MBOs.


Field Summary
protected  EntityAlias __entityAlias
           
protected  JoinCriteria __joinCriteria
           
protected  java.util.Vector __selectItems
           
 
Constructor Summary
Query()
          Sybase internal use only.
Query(int skip, int take, Filter filter, SortOrderCollection sortOrderCollection, int objectState, boolean includeStyles)
          Deprecated.  
Query(int _skip, int _take, TestCriteria _testCriteria, SortCriteria _sortCriteria)
          Sybase internal use only.
 
Method Summary
protected  void _init()
           
 Query from(java.lang.String entity, java.lang.String alias)
          Sybase internal use only.
 EntityMetaData getEntity()
          Sybase internal use only.
 EntityAlias getEntityAlias()
          Sybase internal use only.
 boolean getIncludeStyles()
          Deprecated.  
 JoinCriteria getJoinCriteria()
          Sybase internal use only.
 java.util.Vector getSelectItems()
          Sybase internal use only.
 int getSkip()
          Gets the number of rows to skip, used for paging.
 SortCriteria getSortCriteria()
          Get the data sort criteria object.
 SortOrderCollection getSortOrder()
          Deprecated.  
 int getStateCriteria()
          Deprecated.  
 int getTake()
          Gets the maximum number of rows to take, used for paging.
 TestCriteria getTestCriteria()
          Get the test criteria object
 Query initEntity(EntityMetaData _entity)
          Sybase internal use only.
 Query initSkip(int _skip)
          Sybase internal use only.
 Query initSortCriteria(SortCriteria _sortCriteria)
          Sybase internal use only.
 Query initTake(int _take)
          Sybase internal use only.
 Query initTestCriteria(TestCriteria _testCriteria)
          Sybase internal use only.
 Query join(java.lang.String entity, java.lang.String entityAlias, java.lang.String leftItem, java.lang.String rightItem)
          Sybase internal use only.
 Query orderBy(java.lang.String attribute, int order)
          Sybase internal use only.
 Query select(java.lang.String items)
          Sybase internal use only.
 void setEntity(EntityMetaData _entity)
          Sybase internal use only.
 void setIncludeStyles(boolean includeStyles)
          Deprecated.  
 void setSkip(int _skip)
          Sets the number of rows to skip, used for paging.
 void setSortCriteria(SortCriteria _sortCriteria)
          Set the data sort criteria.
 void setSortOrder(SortOrderCollection sortOrderCollection)
          Deprecated.  
 void setStateCriteria(int objectState)
          Deprecated.  
 void setTake(int _take)
          Sets the maximum number of rows to take, used for paging.
 void setTestCriteria(TestCriteria _testCriteria)
          Set the test criteria
 Query where(TestCriteria test)
          Sybase internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__selectItems

protected java.util.Vector __selectItems

__entityAlias

protected EntityAlias __entityAlias

__joinCriteria

protected JoinCriteria __joinCriteria
Constructor Detail

Query

public Query()
Sybase internal use only.


Query

public Query(int _skip,
             int _take,
             TestCriteria _testCriteria,
             SortCriteria _sortCriteria)
Sybase internal use only.


Query

public Query(int skip,
             int take,
             Filter filter,
             SortOrderCollection sortOrderCollection,
             int objectState,
             boolean includeStyles)
Deprecated. 

Method Detail

initEntity

public Query initEntity(EntityMetaData _entity)
Sybase internal use only.


getEntity

public EntityMetaData getEntity()
Sybase internal use only.


setEntity

public void setEntity(EntityMetaData _entity)
Sybase internal use only.


initTestCriteria

public Query initTestCriteria(TestCriteria _testCriteria)
Sybase internal use only.


getTestCriteria

public TestCriteria getTestCriteria()
Get the test criteria object

Returns:
the test criteria object

setTestCriteria

public void setTestCriteria(TestCriteria _testCriteria)
Set the test criteria

Parameters:
_testCriteria -

initSortCriteria

public Query initSortCriteria(SortCriteria _sortCriteria)
Sybase internal use only.


getSortCriteria

public SortCriteria getSortCriteria()
Get the data sort criteria object.

Returns:
the data sort criteria object

setSortCriteria

public void setSortCriteria(SortCriteria _sortCriteria)
Set the data sort criteria.

Parameters:
_sortCriteria -

getSortOrder

public SortOrderCollection getSortOrder()
Deprecated. 


setSortOrder

public void setSortOrder(SortOrderCollection sortOrderCollection)
Deprecated. 


initSkip

public Query initSkip(int _skip)
Sybase internal use only.


getSkip

public int getSkip()
Gets the number of rows to skip, used for paging.


setSkip

public void setSkip(int _skip)
Sets the number of rows to skip, used for paging.


initTake

public Query initTake(int _take)
Sybase internal use only.


getTake

public int getTake()
Gets the maximum number of rows to take, used for paging.


setTake

public void setTake(int _take)
Sets the maximum number of rows to take, used for paging.


getIncludeStyles

public boolean getIncludeStyles()
Deprecated. 


setIncludeStyles

public void setIncludeStyles(boolean includeStyles)
Deprecated. 


getStateCriteria

public int getStateCriteria()
Deprecated. 


setStateCriteria

public void setStateCriteria(int objectState)
Deprecated. 


_init

protected void _init()

select

public Query select(java.lang.String items)
Sybase internal use only.


from

public Query from(java.lang.String entity,
                  java.lang.String alias)
Sybase internal use only.


join

public Query join(java.lang.String entity,
                  java.lang.String entityAlias,
                  java.lang.String leftItem,
                  java.lang.String rightItem)
Sybase internal use only.


where

public Query where(TestCriteria test)
Sybase internal use only.


orderBy

public Query orderBy(java.lang.String attribute,
                     int order)
Sybase internal use only.


getEntityAlias

public EntityAlias getEntityAlias()
Sybase internal use only.


getJoinCriteria

public JoinCriteria getJoinCriteria()
Sybase internal use only.


getSelectItems

public java.util.Vector getSelectItems()
Sybase internal use only.