|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
QueryFactory provides functionality to create Query, Condition and SortOrder instances.
Examples:
Creating a SingleCondition
//SYNC_KEY > '10000000001' Condition singleCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.GREATER_THAN,"10000000001");Creating a CompositeCondition
//SYNC_KEY > '10000000001' Condition greaterCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.GREATER_THAN,"10000000001"); //SYNC_KEY < '10000000020' Condition lesserCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.LOWER_THAN,"10000000020"); //'10000000001' < SYNC_KEY < '10000000020' Condition[] multipleCondition = new Condition[]{ greaterCondition, lesserCondition }; Condition compositeCondition = queryFactory.createCondition(multipleCondition,LogicalOperatorType.AND);You can pass 'null' for a condition to query for all data. This is especially usefull when it is combined with startIndex and maxCount for displaying a limited amount of data.
Examples:
Creating a SingleSortOrder
//sort in SYNC_KEY field in ASC order Condition singleSortOrder = queryFactory.createSortOrder(syncKeyFieldDescriptor,true);Creating a MultipleSortOrder
//sort in NAME field in ASC order SortOrder nameAscSortOrder = queryFactory.createSortOrder(nameFieldDescriptor,true); //sort in SYNC_KEY field in DESC order SortOrder syncKeyDescSortOrder = queryFactory.createSortOrder(syncKeyFieldDescriptor,false); //sort in NAME field first then in SYNC_KEY field SortOrder[] multipleSortOrder = new SortOrder[]{ nameAscSortOrder, syncKeyDescSortOrder }; Condition compositeSortOrder = queryFactory.createSortOrder(multipleSortOrder);
When JDBC Persistence is used, you should consider using SmartSyncJQueryFactory instead.Examples:
Creating a Row query
//Query for 010 ChildRows with SYNC_KEY > '10000000001' Condition singleCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.GREATER_THAN,"10000000001"); Query rowQuery = queryFactory.createQuery(child101RowDescriptor,singleCondition);Creating a SyncBo query
//Query for SyncBos with SYNC_KEY > '10000000001' Condition singleCondition = queryFactory.createCondition(syncKeyFieldDescriptor,RelationalOperatorType.GREATER_THAN,"10000000001"); Query syncBoQuery = queryFactory.createQuery(syncBoDescriptor,singleCondition);
SmartSyncJQueryFactory
Method Summary | |
Condition |
createCondition(Condition[] conditions,
LogicalOperatorType logicalOperator)
Returns a Condition instance having a multiple Condition entities related with a corresponding logical operator. |
Condition |
createCondition(FieldDescriptor fieldDescriptor,
RelationalOperatorType relationalOperator,
java.lang.Object value)
Returns a Condition instance for the specified FieldDescriptor, RelationalOperatorType and value. |
Query |
createQuery(RowDescriptor rowDescriptor,
Condition condition)
Returns a Query instance for the specified RowDescriptor and Condition objects. |
Query |
createQuery(RowDescriptor rowDescriptor,
Condition condition,
int maxCount)
Returns a Query instance for the specified RowDescriptor and Condition objects, with a maximum count limit. |
Query |
createQuery(RowDescriptor rowDescriptor,
Condition condition,
SortOrder sortOrder)
Returns a Query instance for the specified RowDescriptor, Condition, and SortOrder objects. |
Query |
createQuery(RowDescriptor rowDescriptor,
Condition condition,
SortOrder sortOrder,
int maxCount)
Returns a Query instance for the specified RowDescriptor, SortOrder and Condition objects, with a maximum count limit. |
Query |
createQuery(RowDescriptor rowDescriptor,
Condition condition,
SortOrder sortOrder,
int startIdx,
int maxCount)
Returns a Query instance for the specified RowDescriptor, SortOrder and Condition objects, with a start index and a maximum count limit. |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
Condition condition)
Returns a Query instance for the specified SyncBoDescriptor and Condition objects. |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
Condition condition,
int maxCount)
Returns a Query instance for the specified SyncBoDescriptor and Condition objects with a maximum limit count. |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
Condition condition,
SortOrder sortOrder)
Returns a Query instance for the specified SyncBoDescriptor, Condition and SortOrder objects. |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
Condition condition,
SortOrder sortOrder,
int maxCount)
Returns a Query instance for the specified SyncBoDescriptor, Condition and SortOrder objects with a max count limit |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
Condition condition,
SortOrder sortOrder,
int startIndex,
int maxCount)
Returns a Query instance for the specified SyncBoDescriptor, Condition and SortOrder objects with a starting index and max count limit |
Query |
createQuery(SyncBoDescriptor syncBoDescriptor,
SortOrder sortOrder,
int startIndex,
int maxCount)
Returns a Query instance for the specified SyncBoDescriptor and SortOrder objects with a starting index and max count limit |
SortOrder |
createSortOrder(FieldDescriptor fieldDescriptor,
boolean isAscending)
Returns a simple SortOrder instance for the specified FieldDescriptor and sort order flag. |
SortOrder |
createSortOrder(SortOrder[] sortOrders)
Returns a multiple SortOrder instance. |
SortOrder |
createSortOrderForSyncBoKey(RowDescriptor rowDescriptor,
boolean isAscending)
Creates a sort order for the SyncBo key of the row. |
Method Detail |
public Condition createCondition(FieldDescriptor fieldDescriptor, RelationalOperatorType relationalOperator, java.lang.Object value)
fieldDescriptor
- the FieldDescriptor of the field whose value is to be comparedrelationalOperator
- the RelationalOperator or the comparison operatorvalue
- the reference value to which the field value is to be compared
public Condition createCondition(Condition[] conditions, LogicalOperatorType logicalOperator)
conditions
- the array of Condition entitieslogicalOperator
- the logical operator to which the conditions will be correlated
public SortOrder createSortOrder(FieldDescriptor fieldDescriptor, boolean isAscending)
fieldDescriptor
- the FieldDescriptor of the sort fieldisAscending
- flag indicating whether to sort in ascending manner
public SortOrder createSortOrderForSyncBoKey(RowDescriptor rowDescriptor, boolean isAscending)
rowDescriptor
- row descriptor of the child rowisAscending
- flag indicating whether to sort in ascending manner
public SortOrder createSortOrder(SortOrder[] sortOrders)
sortOrders
- the SortOrder entities
public Query createQuery(RowDescriptor rowDescriptor, Condition condition) throws PersistenceException
rowDescriptor
- the RowDescriptor of the Row to be searchedcondition
- a Condition instance; could be a single or composite condition
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(RowDescriptor rowDescriptor, Condition condition, SortOrder sortOrder) throws PersistenceException
rowDescriptor
- the RowDescriptor of the Row to be searchedcondition
- a Condition instance; could be a single or composite conditionsortOrder
- the SortOrder instance; could be a single or multiple sort order fields
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(RowDescriptor rowDescriptor, Condition condition, int maxCount) throws PersistenceException
rowDescriptor
- the RowDescriptor of the Row to be searchedcondition
- a Condition instance; could be a single or composite conditionmaxCount
- the maximum number of Row entities to be returned
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(RowDescriptor rowDescriptor, Condition condition, SortOrder sortOrder, int maxCount) throws PersistenceException
rowDescriptor
- the RowDescriptor of the Row to be searchedcondition
- a Condition instance; could be a single or composite conditionsortOrder
- the SortOrder instance; could be a single or multiple sort order fieldsmaxCount
- the maximum number of Row entities to be returned
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(RowDescriptor rowDescriptor, Condition condition, SortOrder sortOrder, int startIdx, int maxCount) throws PersistenceException
rowDescriptor
- the RowDescriptor of the Row to be searchedcondition
- a Condition instance; could be a single or composite conditionsortOrder
- the SortOrder instance; could be a single or multiple sort order fieldsmaxCount
- the maximum number of Row entities to be returned
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, Condition condition) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedcondition
- a Condition instance; could be a single or composite condition
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, Condition condition, SortOrder sortOrder) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedcondition
- a Condition instance; could be a single or composite conditionsortOrder
- the SortOrder instance; could be a single or multiple sort order fields
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, Condition condition, int maxCount) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedcondition
- a Condition instance; could be a single or composite conditionmaxCount
- the maximum number of SyncBo entities to be returned
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, SortOrder sortOrder, int startIndex, int maxCount) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedsortOrder
- the SortOrder instance; could be a single or multiple sort order fieldsstartIndex
- the starting index number of the SyncBo object in the list; should be either 0 or any integer greater than 0maxCount
- the maximum number of SyncBo entities from the starting index to be retrieved
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, Condition condition, SortOrder sortOrder, int startIndex, int maxCount) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedsortOrder
- the SortOrder instance; could be a single or multiple sort order fieldsstartIndex
- the starting index number of the SyncBo object in the list; should 0 or greatermaxCount
- the maximum number of SyncBo entities from the starting index to be retrieved
PersistenceException
- is thrown if a persistent related error occured during the creationpublic Query createQuery(SyncBoDescriptor syncBoDescriptor, Condition condition, SortOrder sortOrder, int maxCount) throws PersistenceException
syncBoDescriptor
- the SyncBoDescriptor of the SyncBos to be searchedsortOrder
- the SortOrder instance; could be a single or multiple sort order fieldsmaxCount
- the maximum number of SyncBo entities from the starting index to be retrieved
PersistenceException
- is thrown if a persistent related error occured during the creation
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |