public class QueryByExampleMechanism extends ExpressionQueryMechanism
Purpose: Mechanism used for all queries by example.
Responsibilities: Builds a selection criteria for this query given an example object and a QueryByExample policy. Works akin to EBQLMechanism which builds the selection criteria from an EJBQL string.
Constructor and Description |
---|
QueryByExampleMechanism(DatabaseQuery query)
Initialize the state of the query
|
QueryByExampleMechanism(DatabaseQuery query,
Expression expression)
Initialize the state of the query
|
Modifier and Type | Method and Description |
---|---|
void |
buildSelectionCriteria(AbstractSession session)
INTERNAL:
In the case of EJBQL or query by example, an expression needs to be
generated.
|
java.lang.Object |
getExampleObject()
PUBLIC:
This method returns the current example object.
|
QueryByExamplePolicy |
getQueryByExamplePolicy()
PUBLIC:
When using Query By Example, an instance of QueryByExamplePolicy is used to customize the query.
|
boolean |
isParsed()
INTERNAL:
Is this query Parsed
|
boolean |
isQueryByExampleMechanism()
Return true if this is a query by example mechanism
|
void |
setExampleObject(java.lang.Object newExampleObject)
PUBLIC:
Set the example object of the query to be the newExampleObject.
|
void |
setIsParsed(boolean newIsParsed)
INTERNAL:
Set the isParsed state
|
void |
setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy)
PUBLIC:
The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used.
|
aliasPresetFields, buildBaseSelectionCriteria, buildBaseSelectionCriteria, buildBaseSelectStatement, buildBaseSelectStatement, checkCacheForObject, clearStatement, clone, extractStatementFromItem, getExpressionBuilder, getSelectionCriteria, getSelectionFields, isExpressionQueryMechanism, isStatementQueryMechanism, prepare, prepareCursorSelectAllRows, prepareDeleteAll, prepareDeleteObject, prepareDoesExist, prepareInsertObject, prepareReportQuerySelectAllRows, prepareReportQuerySubSelect, prepareSelectAllRows, prepareSelectOneRow, prepareUpdateAll, prepareUpdateObject, selectAllReportQueryRows, selectAllRows, selectAllRowsFromConcreteTable, selectAllRowsFromTable, selectOneRow, selectOneRowFromConcreteTable, selectOneRowFromTable, setSelectionCriteria
deleteObject, executeNoSelect, getSQLStatement, getSQLStatements, hasMultipleStatements, insertObject, insertObject, isCallQueryMechanism, prepareExecuteNoSelect, prepareExecuteSelect, setSQLStatement, trimFieldsForInsert, updateObject
getDatabaseCall, prepareCall, prepareExecute, setCallHasCustomSQLArguments, unprepare, updateForeignKeyFieldBeforeDelete
addCall, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, execute, executeDeferredCall, executeNoSelectCall, executeSelect, executeSelectCall, getCall, getCalls, hasMultipleCalls, selectResultSet, selectRowForDoesExist, setCall, updateAll, updateAllUsingTempTables
clone, executeWrite, executeWriteWithChangeSet, getModifyRow, getQuery, insertObjectForWrite, isJPQLCallQueryMechanism, setQuery, updateObjectForWrite, updateObjectForWriteWithChangeSet
public QueryByExampleMechanism(DatabaseQuery query)
query
- - owner of mechanismpublic QueryByExampleMechanism(DatabaseQuery query, Expression expression)
query
- - owner of mechanismexpression
- - selection criteriapublic void buildSelectionCriteria(AbstractSession session)
buildSelectionCriteria
in class DatabaseQueryMechanism
public java.lang.Object getExampleObject()
public QueryByExamplePolicy getQueryByExamplePolicy()
public boolean isParsed()
public boolean isQueryByExampleMechanism()
isQueryByExampleMechanism
in class DatabaseQueryMechanism
public void setExampleObject(java.lang.Object newExampleObject)
public void setIsParsed(boolean newIsParsed)
public void setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference