|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.adapter.gsa.query.Builder
public class Builder
A query builder that builds queries for a sepcific type of
RepositoryItem
. The type of item is defined by the property
itemDescriptor
.
Nested Class Summary | |
---|---|
protected class |
Builder.GroupPropertyExpression
Used internally to mark a property expression which refers to a group. |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
atg.adapter.gsa.query.ParameterExpression |
mSingleParameterExpression
A single instance of a ParameterExpression that will be used as a placeholder for parameters in a query |
Fields inherited from interface atg.adapter.gsa.Constants |
---|
ATTR_CASCADE_DELETE_ORDER, ATTR_CSW_PROPERTIES, ATTR_CSW_QUERIES, ATTR_CURRENT_ITEM_CACHE_SIZE, ATTR_CURRENT_ITEM_CACHE_TIMEOUT, ATTR_DEFAULT_UNCACHED_ITEM_QUERIES, ATTR_HEAD_OF_LINE_CACHE_SIZE, ATTR_HEAD_OF_LINE_CACHE_TIMEOUT, ATTR_LOADING_STRATEGY, ATTR_SPLIT_QUERIES, ATTR_TEXT_HANDLE_COLUMN, ATTR_TEXT_INDEX_TABLE, ATTR_UPDATE_LAST_MODIFIED, CASCADE_DELETE_AFTER_AUX_BEFORE_PRI, CASCADE_DELETE_FIRST, CASCADE_DELETE_LAST, CASCADE_DELETE_ORDER_NAMES, DEFAULT_EVENT_SERVER, DEFAULT_GSA_CACHE_CLIENT_MANAGER, DEFAULT_INVALIDATOR_SERVICE, ERR_ADD_MISSING_PROPERTIES, ERR_ADD_NON_TRANSIENT, ERR_ARGS_FOR_NON_PARAMETER_QUERY, ERR_BAD_EVENT_DATA, ERR_BAD_TABLE, ERR_CIRCULAR_REFERENCE, ERR_CLASS_NOT_FOUND, ERR_COMPARE_MULTI, ERR_COMPARE_NONCOMPARABLE, ERR_CONTENT_PROPERTIES_NOT_DEFINED, ERR_COULD_NOT_UNSUBSCRIBE, ERR_DEPENDENT_PROP_NOT_EXISTS, ERR_DEPENDENT_PROP_NULL, ERR_DS_PREPARE, ERR_DS_SWITCH, ERR_DUPLICATES, ERR_FOLDER_PROPERTIES_NOT_DEFINED, ERR_HANDLING_INVALIDATE_CACHE_ENTRY, ERR_ID_SPACE_CONFIGURATION, ERR_ILLEGAL_PARAM_TYPE, ERR_INITIALIZING_ID_GENERATOR, ERR_INVALID_COMPARISON_QUERY, ERR_INVALID_DATA_TYPE_NAME, ERR_INVALID_ITEM, ERR_INVALID_ITEM_DESCRIPTOR_NAME, ERR_INVALID_KEY, ERR_INVALID_KEY_ELEMENT, ERR_INVALID_KEY_ENCODING, ERR_INVALID_KEY_VALUES, ERR_INVALID_LIST_INDEX, ERR_INVALID_PATTERNMATCH_QUERY, ERR_INVALID_PROPERTY, ERR_INVALID_QUERY, ERR_INVALID_QUERY_ELEMENT, ERR_INVALID_TEXT_SEARCH_QUERY, ERR_INVALID_TM_DS_COMBO, ERR_ITEM_NOT_EXIST, ERR_LOAD_COLUMN_INFO, ERR_MISSING_ID_SPACE, ERR_NO_ARGS_FOR_QUERY, ERR_NO_DATABASE_TABLE_INFO, ERR_NO_DATATYPE_FOR_PROPERTY, ERR_NO_DB2_HANDLE, ERR_NO_DEFAULT_SEARCH_PROPERTIES, ERR_NO_EVENT_SERVER, ERR_NO_IDS, ERR_NO_LOWER_FUNCTION, ERR_NO_PARAMETER_EXPRESSION, ERR_NO_PARSER, ERR_NO_PRIMARY_TABLE, ERR_NO_SUB_PROPERTIES, ERR_NO_SUBSCRIBER_ITEM_DESCRIPTOR, ERR_NO_SYB_TEXT_INDEX, ERR_NO_TEMPLATE_FILES, ERR_NO_TRANSACTION, ERR_NO_TRANSIENT_QUERIES, ERR_NOT_DISTRIBUTED_MODE, ERR_NULL_ARGUMENT, ERR_NULL_ID, ERR_NULL_ITEM, ERR_NULL_QUERY_OPTIONS, ERR_PARSING_TEMPLATE, ERR_PROCEDURE_HELPER_INIT, ERR_PROPERTY_NOT_QUERYABLE, ERR_RETURN_PROP_NOT_EXISTS, ERR_RETURN_PROP_NOT_GSA, ERR_RETURN_PROP_NOT_READ, ERR_RETURN_PROP_NULL, ERR_RQL_FILTER, ERR_SQL_STRING_NULL, ERR_SUB_TYPE_PROPERTY_ON_NON_ROOT_TYPE, ERR_TABLE_KEY_UNMATCHED, ERR_TRANSACTION, ERR_TYPE_MATCHING, ERR_UNABLE_TO_READ_TEMPLATE_FILE, ERR_UNKNOWN_EVENT_TYPE, ERR_VERSION_PROPERTY_INVALID_TYPE, ERR_VIEW_IS_TRANSIENT, ERR_WRONG_NUMBER_ARGS_FOR_QUERY, FTS_LANG_DB2, FTS_LANG_MSSQL, FTS_LANG_MSSQL_INLINE, FTS_LANG_ORACLE, FTS_LANG_SYBASE, INFO_STARTUP_BEGIN, INFO_STARTUP_END, ISOLATION_LEVEL_NAMES, LOADING_STRATEGY_DEFAULT, LOADING_STRATEGY_EAGER, LOADING_STRATEGY_LAZY, READ_COMMITTED, REPEATABLE_READ, REPOSITORY_COMPONENT_NAME, RESOURCE_BUNDLE_NAME, SERIALIZABLE, SUBSCRIBER_ADDRESS_PROPERTY, SUBSCRIBER_ITEM_DESCRIPTOR_NAME, SUBSCRIBER_ITEM_DESCRIPTOR_PROPERTY, SUBSCRIBER_PORT_PROPERTY, SUBSCRIBER_REPOSITORY_PROPERTY, WARN_PROBLEM_SENDING_EVENT, WARN_RETURN_PROP_MULTI, WARN_RETURN_PROP_TRANSIENT |
Fields inherited from interface atg.repository.QueryBuilder |
---|
CONTAINS, ENDS_WITH, EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUALS, LESS_THAN, LESS_THAN_OR_EQUALS, NOT_CONTAINS, NOT_ENDS_WITH, NOT_EQUALS, NOT_STARTS_WITH, STARTS_WITH |
Constructor Summary | |
---|---|
Builder(GSAItemDescriptor pItemDescriptor)
Construct a builder for the given item descriptor |
Method Summary | |
---|---|
Query |
addContextMembershipFilters(Query pQuery,
atg.repository.ContextFilteringRules pRules)
Add context membership query filters to the given query based on the ContextFilteringRules supplied. |
protected boolean |
areTypesCompatible(RepositoryItemDescriptor pSuperType,
RepositoryItemDescriptor pSubType)
Check type for querying compatibility. |
protected Query |
constantQuery(boolean pValue)
Utility routine for generating a query which always evaluates to true or false. |
Query |
createAndQuery(Query[] pQueryElements)
Creates a query representing the logical AND of several queries. |
Query |
createComparisonQuery(QueryExpression pLeft,
QueryExpression pRight,
int pComparisonOperator)
Create a query representing a logical comparison between two expressions. |
Query |
createComparisonQuery(atg.adapter.gsa.query.Value pLeft,
atg.adapter.gsa.query.Value pRight,
int pComparisonOperator)
Create a query representing a logical comparison between two constant value expressions. |
QueryExpression |
createConstantQueryExpression(java.lang.Object pValue)
Returns a QueryExpression for the supplied constant object |
QueryExpression |
createCountQueryExpression(QueryExpression pCollection)
Returns a QueryExpression which represents the total number of elements for a collection for the given item. |
Query |
createDirectSqlQuery(java.lang.String pQuery,
RepositoryPropertyDescriptor[] pReturnedProps,
RepositoryPropertyDescriptor[] pDependentProps,
java.lang.Class[] pInputParameterClasses)
This is a variation of the SqlPassThroughQuery that can call stored procedures as well as execute straight sql. |
Query |
createDirectSqlQuery(java.lang.String pQuery,
RepositoryPropertyDescriptor[] pReturnedProps,
RepositoryPropertyDescriptor[] pDependentProps,
java.lang.Class[] pInputParameterClasses,
boolean pIsStoredProcedure)
This is a variation of the SqlPassThroughQuery that can call stored procedures as well as execute straight sql. |
QueryExpression |
createElementAtQueryExpression(QueryExpression pIndex,
QueryExpression pCollection)
Returns a QueryExpression which represents an element in a collection of a property at a specified index. |
protected Query |
createGroupComparisonQuery(QueryExpression pExpr1,
QueryExpression pExpr2,
int pRelation)
Creates a comparison query where one operator is a constant and the other is a group. |
Query |
createIdMatchingQuery(atg.repository.CompositeKey[] pIds)
Create a query which returns the items that have the supplied ids. |
Query |
createIdMatchingQuery(java.lang.String[] pIds)
Create a query which returns the items that have the supplied ids. |
Query |
createIncludesAllQuery(QueryExpression pCollection1,
QueryExpression pCollection2)
Creates a query that is matched if the property, which must evaluate to a Collection-like object, includes all of the values in the second Collection-like object. |
Query |
createIncludesAnyQuery(QueryExpression pCollection1,
QueryExpression pCollection2)
Creates a query that is matched if the property, which must evaluate to a Collection-like object, includes any of the values in the second Collection-like object. |
Query |
createIncludesItemQuery(QueryExpression pCollection,
Query pQuery)
Creates a query that is matched if the property, which must evaluate to a Collection, Map, or array of repository items, has at least one item which matches the query provided. |
Query |
createIncludesQuery(QueryExpression pCollection,
QueryExpression pItem)
Creates a query that is matched if the property, which must evaluate to a Collection-like object, includes the supplied value. |
QueryExpression |
createIndexOfQueryExpression(QueryExpression pItem,
QueryExpression pCollection)
Returns a QueryExpression which represents the numeric index location of the supplied object in the given collection |
Query |
createInFoldersQuery(atg.repository.CompositeKey[] pFolderIds)
Returns a query which when executed would return all the pieces of content which are contained within the supplied folders. |
Query |
createInFoldersQuery(java.lang.String[] pFolderIds)
Returns a query which when executed would return all the pieces of content which are contained within the supplied folders. |
Query |
createIsNullQuery(QueryExpression pProperty)
Creates a query that is matched if the property is null. |
Query |
createNotQuery(Query pQueryElement)
Creates a query representing the logical NOT of a query |
Query |
createOrQuery(Query[] pQueryElements)
Creates a query representing the logical OR of several queries. |
Query |
createParameterComparisonQuery(atg.adapter.gsa.query.Atom pLeft,
atg.adapter.gsa.query.Atom pRight,
atg.adapter.gsa.query.Operator pComparisonOperator)
Creates a comparison query where one or more expressions in the query is a ParameterExpression |
Query |
createParameterPatternMatchQuery(QueryExpression pValueString,
atg.adapter.gsa.query.ParameterExpression pPatternString,
int pMatchingOperation,
boolean pIgnoreCase,
boolean pEscapeWildcards)
Creates a case-sensitive query representing a pattern matching operation. |
QueryExpression |
createParameterQueryExpression()
Creates a parameter QueryExpression, which is just a placeholder in a Query for a parameter to be determined at execution time When inserted into a query object the index of this expression could be changed at runtime, since it could be ANDed or ORed multiple times |
protected Query |
createParameterTextSearchQuery(atg.adapter.gsa.query.PropertyExpression pProperty,
atg.adapter.gsa.query.ParameterExpression pSearchString,
java.lang.String pSearchStringFormat,
atg.adapter.gsa.query.Value pMinScore)
Creates a query representing the full text search query operation. |
Query |
createPatternMatchQuery(QueryExpression pValueString,
QueryExpression pPatternString,
int pMatchingOperation)
Creates a case-sensitive query representing a pattern matching operation. |
Query |
createPatternMatchQuery(QueryExpression pValueString,
QueryExpression pPatternString,
int pMatchingOperation,
boolean pIgnoreCase)
Creates a case-sensitive query representing a pattern matching operation. |
Query |
createPatternMatchQuery(QueryExpression pValueString,
QueryExpression pPatternString,
int pMatchingOperation,
boolean pIgnoreCase,
boolean pEscapeWildcards)
Creates a query representing a pattern matching operation. |
QueryExpression |
createPropertyQueryExpression(QueryExpression pParentProperty,
java.lang.String pPropertyName)
Returns a property query expression for the named property of the supplied property query expression. |
QueryExpression |
createPropertyQueryExpression(java.lang.String pPropertyName)
Returns a property query expression for the supplied property name. |
Query |
createReferencedByQuery(RepositoryPropertyDescriptor pPropertyDescriptor,
Query pQuery)
Creates a query that checks references from another item descriptor. |
Query |
createSqlPassthroughQuery(java.lang.String pSqlString,
java.lang.Object[] pArgs)
Returns a query which when executed performs a query against the database with the specified SQL string, which overrides SQL string which would be used by the GSA to perform this query, or any query built using this query. |
Query |
createTextSearchQuery(QueryExpression pSearchString,
QueryExpression pSearchStringFormat,
QueryExpression pMinScore)
Creates a query representing the full text search query operation. |
Query |
createTextSearchQuery(QueryExpression pProperty,
QueryExpression pSearchString,
QueryExpression pSearchStringFormat,
QueryExpression pMinScore)
Creates a query representing the full text search query operation. |
Query |
createUnconstrainedQuery()
Creates a query which when executed returns all of the items in the repository, Nota Bene: This is a potentially very expensive operation. |
java.lang.String |
format(java.lang.String pMsgKey)
Utility for formatting messages with no arguments. |
java.lang.String |
format(java.lang.String pMsgKey,
java.lang.Object pArg)
|
java.lang.String |
format(java.lang.String pMsgKey,
java.lang.Object[] pArgs)
Utility for formatting predefined messages using our respository's resource bundle. |
java.lang.String |
format(java.lang.String pMsgKey,
java.lang.Object pArg1,
java.lang.Object pArg2)
|
GSAItemDescriptor |
getItemDescriptor()
Get property itemDescriptor . |
ApplicationLogging |
getLogger()
Get a logger to use for derived property related errors and debug messages. |
atg.adapter.gsa.GSARepository |
getRepository()
Get property Repository |
RepositoryView |
getRepositoryView()
Gets the repository view for this query builder |
protected atg.adapter.gsa.query.Operator |
getValidOperator(int pCode)
Get the operator specified, by the code. |
Query |
rebuild(Query pQuery,
atg.repository.dp.TranslationContext pContext)
Rebuild the specified query using the specified query builder. |
java.lang.String |
toString()
Get a string representation of this object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
public atg.adapter.gsa.query.ParameterExpression mSingleParameterExpression
Constructor Detail |
---|
public Builder(GSAItemDescriptor pItemDescriptor)
Method Detail |
---|
public GSAItemDescriptor getItemDescriptor()
itemDescriptor
. The item descriptor describing
the item type which we know how to query.
itemDescriptor
public RepositoryView getRepositoryView()
getRepositoryView
in interface QueryBuilder
public atg.adapter.gsa.GSARepository getRepository()
Repository
Repository
public Query createIdMatchingQuery(java.lang.String[] pIds) throws RepositoryException
createIdMatchingQuery
in interface QueryBuilder
pIds
- array of desired ids, must contain at least one id
RepositoryException
- if pIds is null or zero-lengh or if there
is an error building the querypublic Query createIdMatchingQuery(atg.repository.CompositeKey[] pIds) throws RepositoryException
createIdMatchingQuery
in interface atg.repository.CompositeIdQueryBuilder
pIds
- array of desired ids
RepositoryException
- if pIds is null or zero-lengh or if there
is an error building the querypublic QueryExpression createConstantQueryExpression(java.lang.Object pValue) throws RepositoryException
createConstantQueryExpression
in interface QueryBuilder
pValue
- a "constant object" whose value can be determined
immediately. For scalar values this can be one of:
For collection like values this can be one of:
Eeach element of the Collection or array must be a scalar primitive object, as defined above. The Collection or array is used as-is, no copy is made.
RepositoryException
- if there is an error
building the querypublic QueryExpression createParameterQueryExpression() throws RepositoryException
createParameterQueryExpression
in interface ParameterSupportQueryBuilder
a
- RepositoryException if an expression
cannot be made using this QueryBuilder
RepositoryException
- if an expression
cannot be made using this QueryBuilderpublic QueryExpression createPropertyQueryExpression(java.lang.String pPropertyName) throws RepositoryException
createPropertyQueryExpression
in interface atg.repository.dp.DerivedPropertyQueryBuilder
createPropertyQueryExpression
in interface QueryBuilder
pPropertyName
- the name of the property to evaluate
RepositoryException
- if there is an error
building the querypublic QueryExpression createPropertyQueryExpression(QueryExpression pParentProperty, java.lang.String pPropertyName) throws RepositoryException
createPropertyQueryExpression
in interface QueryBuilder
pParentProperty
- the property expression which contains the property
named by pPropertyNamepPropertyName
- the name of the property to evaluate
RepositoryException
- if the query is invalidpublic Query createAndQuery(Query[] pQueryElements) throws RepositoryException
createAndQuery
in interface QueryBuilder
RepositoryException
- if there is an error
building the querypublic Query createOrQuery(Query[] pQueryElements) throws RepositoryException
createOrQuery
in interface QueryBuilder
RepositoryException
- if there is an error
building the querypublic Query createNotQuery(Query pQueryElement) throws RepositoryException
createNotQuery
in interface QueryBuilder
RepositoryException
- if there is an error
building the querypublic Query createComparisonQuery(QueryExpression pLeft, QueryExpression pRight, int pComparisonOperator) throws RepositoryException
createComparisonQuery
in interface QueryBuilder
pLeft
- first (LHS) item in the comparisonpRight
- second (RHS) item in the comparisonpComparisonOperator
- the comparison operator to use, one of:
NB: the caller is responsible for insuring that pComparisonOperator is one of the valid choices
RepositoryException
- if there is an error
building the queryQueryBuilder
public Query createComparisonQuery(atg.adapter.gsa.query.Value pLeft, atg.adapter.gsa.query.Value pRight, int pComparisonOperator) throws RepositoryException
pLeft
- first (LHS) item in the comparison, must implement ComparablepRight
- second (RHS) item in the comparison, must be supported by
pLeft for comparisonspComparisonOperator
- comparison operator to use
RepositoryException
- if there is an error building the querypublic Query createParameterComparisonQuery(atg.adapter.gsa.query.Atom pLeft, atg.adapter.gsa.query.Atom pRight, atg.adapter.gsa.query.Operator pComparisonOperator) throws RepositoryException
pLeft
- the left expressionpRight
- the right expressionpComparisonOperator
- the operator used to compare the left
and right expressions
RepositoryException
- if an error occurs while creating
the queryprotected final atg.adapter.gsa.query.Operator getValidOperator(int pCode) throws RepositoryException
pCode
- int code of operator to get
RepositoryException
- if the code is invalidprotected Query createGroupComparisonQuery(QueryExpression pExpr1, QueryExpression pExpr2, int pRelation) throws RepositoryException
RepositoryException
public Query createIsNullQuery(QueryExpression pProperty) throws RepositoryException
createIsNullQuery
in interface QueryBuilder
RepositoryException
- if there is an error
building the querypublic Query createPatternMatchQuery(QueryExpression pValueString, QueryExpression pPatternString, int pMatchingOperation) throws RepositoryException
pMatchingOperation
must be once of:
Be advised that STARTS_WITH and EQUALS queries can be optimized easily using DB indexes. The other pattern match queries generally cannot be.
createPatternMatchQuery
in interface QueryBuilder
pValueString
- the string which is searched for the substring. This
must have been created with createPropertyQueryExpression()
or createConstantQueryExpression
pPatternString
- the pattern to search for. This
must have been created with createConstantQueryExpression
pMatchingOperation
- the type of match to search for
RepositoryException
- if there is an error building the querypublic Query createPatternMatchQuery(QueryExpression pValueString, QueryExpression pPatternString, int pMatchingOperation, boolean pIgnoreCase) throws RepositoryException
pMatchingOperation
must be once of:
Be advised that STARTS_WITH and EQUALS queries can be optimized easily using DB indexes. The other pattern match queries generally cannot be.
createPatternMatchQuery
in interface QueryBuilder
pValueString
- the string which is searched for the substring. This
must have been created with createPropertyQueryExpression()
or createConstantQueryExpression
pPatternString
- the pattern to search for. This
must have been created with createConstantQueryExpression
or
createParameterQueryExpression
pMatchingOperation
- the type of match to search forpIgnoreCase
- if false match is case-sensitive, if true match is
case-insensitive
RepositoryException
- if there is an error building the querypublic Query createPatternMatchQuery(QueryExpression pValueString, QueryExpression pPatternString, int pMatchingOperation, boolean pIgnoreCase, boolean pEscapeWildcards) throws RepositoryException
pMatchingOperation
must
be one of:
Be advised that STARTS_WITH and EQUALS queries can be optimized easily using DB indexes. The other pattern match queries generally cannot be. Likewise case-insensitive pattern matching may affect the ability of the database to optimize the query.
pValueString
- the string which is searched for the substring. This
must have been created with createPropertyQueryExpression()
or createConstantQueryExpression
pPatternString
- the pattern to search for. This
must have been created with createConstantQueryExpression
pMatchingOperation
- the type of match to search forpIgnoreCase
- if false match is case-sensitive, if true match is
case-insensitivepEscapeWildcards
- escape wildcards in search string
RepositoryException
- if there is an error building the querypublic Query createParameterPatternMatchQuery(QueryExpression pValueString, atg.adapter.gsa.query.ParameterExpression pPatternString, int pMatchingOperation, boolean pIgnoreCase, boolean pEscapeWildcards) throws RepositoryException
pMatchingOperation
must be once of:
Be advised that STARTS_WITH and EQUALS queries can be optimized easily using DB indexes. The other pattern match queries generally cannot be.
pValueString
- the string which is searched for the substring. This
must have been created with createPropertyQueryExpression()
or createConstantQueryExpression
pPatternString
- the pattern to search for. This
must have been created with createParameterQueryExpression
pMatchingOperation
- the type of match to search forpIgnoreCase
- if false match is case-sensitive, if true match is
case-insensitive
RepositoryException
- if there is an error building the querypublic Query createTextSearchQuery(QueryExpression pProperty, QueryExpression pSearchString, QueryExpression pSearchStringFormat, QueryExpression pMinScore) throws RepositoryException
createTextSearchQuery
in interface QueryBuilder
pProperty
- should be a PropertyQueryExpression specifying the
property whose text value should be searched. This value can be null to
search the default set of properties for this item descriptor in this
repository.pSearchString
- the string containing the full text search querypSearchStringFormat
- the name of the format that the full text
search query. If you specify null here, a default format is used. To
see the list of formats supported by a particular repository, check the
SupportedQueries.getSearchStringFormatsSupported() property.pMinScore
- This specifies an integer value from 0 to 100. It can
be used as a hint to the search engine to control how close a match must
be for an item to be returned.
RepositoryException
- if there is an error building the querypublic Query createTextSearchQuery(QueryExpression pSearchString, QueryExpression pSearchStringFormat, QueryExpression pMinScore) throws RepositoryException
createTextSearchQuery
in interface QueryBuilder
pSearchString
- the string containing the full text search querypSearchStringFormat
- the name of the format that the full text
search query. If you specify null here, a default format is used. To
see the list of formats supported by a particular repository, check the
SupportedQueries.getSearchStringFormatsSupported() property.pMinScore
- This specifies an integer value from 0 to 100. It can
be used as a hint to the search engine to control how close a match must
be for an item to be returned.
RepositoryException
- if there is an error building the queryprotected Query createParameterTextSearchQuery(atg.adapter.gsa.query.PropertyExpression pProperty, atg.adapter.gsa.query.ParameterExpression pSearchString, java.lang.String pSearchStringFormat, atg.adapter.gsa.query.Value pMinScore) throws RepositoryException
pSearchString
- the string containing the full text search querypSearchStringFormat
- the name of the format that the full text
search query. If you specify null here, a default format is used. To
see the list of formats supported by a particular repository, check the
SupportedQueries.getSearchStringFormatsSupported() property.
RepositoryException
- if there is an error building the querypublic Query createUnconstrainedQuery()
createUnconstrainedQuery
in interface QueryBuilder
public QueryExpression createElementAtQueryExpression(QueryExpression pIndex, QueryExpression pCollection) throws RepositoryException
createElementAtQueryExpression
in interface QueryBuilder
pCollection
- should evaluate into a collectionpIndex
- should evaluate into a value which can be used to return the element
at specific location of the collection.
like operation (e.g. an int or long)
RepositoryException
- if there is an error
building the querypublic QueryExpression createIndexOfQueryExpression(QueryExpression pItem, QueryExpression pCollection) throws RepositoryException
createIndexOfQueryExpression
in interface QueryBuilder
pCollection
- should evaluate into a collectionpItem
- should evaluate into a value which will be looked for in the
collection
RepositoryException
- if there is an error
building the querypublic Query createIncludesQuery(QueryExpression pCollection, QueryExpression pItem) throws RepositoryException
createIncludesQuery
in interface QueryBuilder
pCollection
- should evaluate into a collectionpItem
- should evaluate into a value which will be looked for in the
collection
RepositoryException
- if there is an error
building the querypublic Query createIncludesAnyQuery(QueryExpression pCollection1, QueryExpression pCollection2) throws RepositoryException
createIncludesAnyQuery
in interface QueryBuilder
pCollection1
- should evaluate into a collectionpCollection2
- should evaluate into a collection of values which
will be looked for in the first collection
RepositoryException
- if there is an error
building the querypublic Query createIncludesAllQuery(QueryExpression pCollection1, QueryExpression pCollection2) throws RepositoryException
createIncludesAllQuery
in interface QueryBuilder
pCollection1
- should evaluate into a collectionpCollection2
- should evaluate into a collection of values which
will be looked for in the first collection
RepositoryException
- if there is an error
building the querypublic Query createIncludesItemQuery(QueryExpression pCollection, Query pQuery) throws RepositoryException
createIncludesItemQuery
in interface QueryBuilder
pCollection
- should be a PropertyQueryExpression which refers to
a collection of itemspQuery
- a query which should match the referenced repository items
RepositoryException
- if the query is invalidpublic Query createReferencedByQuery(RepositoryPropertyDescriptor pPropertyDescriptor, Query pQuery) throws RepositoryException
createReferencedByQuery
in interface QueryBuilder
pPropertyDescriptor
- The referencing property descriptor.pQuery
- a query which should match the referencing repository items
RepositoryException
- if the query is invalidprotected boolean areTypesCompatible(RepositoryItemDescriptor pSuperType, RepositoryItemDescriptor pSubType)
public QueryExpression createCountQueryExpression(QueryExpression pCollection) throws RepositoryException
createCountQueryExpression
in interface QueryBuilder
pCollection
- should evaluate into a collection of items
which can be counted.
RepositoryException
- if there is an error
building the querypublic Query createInFoldersQuery(java.lang.String[] pFolderIds) throws RepositoryException
createInFoldersQuery
in interface ContentQueryBuilder
pFolderIds
- an array of ids which represent folders
RepositoryException
- if there was an error building the query operationpublic Query createInFoldersQuery(atg.repository.CompositeKey[] pFolderIds) throws RepositoryException
createInFoldersQuery
in interface atg.repository.CompositeIdQueryBuilder
pFolderIds
- an array of ids which represent folders
RepositoryException
- if there was an error building the query operationpublic Query createSqlPassthroughQuery(java.lang.String pSqlString, java.lang.Object[] pArgs) throws RepositoryException
Caution: The repository cannot use the results of arbitrary queries to generate repository items. The query must return the ID column or columns in their declared order from the repository template. Sql passed to this method is not validated to check if it meets this requirement.
pSqlString
- the SQL string to use
RepositoryException
- if there was an error building the query operationpublic Query createDirectSqlQuery(java.lang.String pQuery, RepositoryPropertyDescriptor[] pReturnedProps, RepositoryPropertyDescriptor[] pDependentProps, java.lang.Class[] pInputParameterClasses) throws RepositoryException
pReturnedProps
property. Also, these Queries
can be cached and can have property dependencies like other queries
pQuery
- the SQL string to executepReturnedProps
- an array of property descriptors that are
expected to be returned from the query when the SQL is executed. Note
that this may or may not include an id property if one is defined
for the view this Builder pertains to. Also note that the order
that the properties appear in this array is the order that
the associated columns for the properties must be returned. These
properties must fit the following rules:
1) Must not be transient
2) Must not be multi-valued
3) Must be readablepDependentProps
- an array of property descriptors that this
query will depend upon for caching. So if any of these properties
change for a given item that is returned from this query, it will
be removed from the query cachepInputParameterClasses
- an array of Classes that correspond to
the types of the input parameters in this query, if any. The first
element in the array maps to the first input parameter in the query,
and so on
a
- RepositoryException if the arguments are incorrect
RepositoryException
public Query createDirectSqlQuery(java.lang.String pQuery, RepositoryPropertyDescriptor[] pReturnedProps, RepositoryPropertyDescriptor[] pDependentProps, java.lang.Class[] pInputParameterClasses, boolean pIsStoredProcedure) throws RepositoryException
pReturnedProps
property. Also, these Queries
can be cached and can have property dependencies like other queries
pQuery
- the SQL string to executepReturnedProps
- an array of property descriptors that are
expected to be returned from the query when the SQL is executed. Note
that this may or may not include an id property if one is defined
for the view this Builder pertains to. Also note that the order
that the properties appear in this array is the order that
the associated columns for the properties must be returned, if
pStrictOrdering
is true. These
properties must fit the following rules:
1) Must not be transient
2) Must not be multi-valued
3) Must be readablepDependentProps
- an array of property descriptors that this
query will depend upon for caching. So if any of these properties
change for a given item that is returned from this query, it will
be removed from the query cachepInputParameterClasses
- an array of Classes that correspond to
the types of the input parameters in this query, if any. The first
element in the array maps to the first input parameter in the query,
and so onpIsStoredProcedure
- if this is true, then the pQuery
string is assumed to be a call to a stored procedure. A JDBC
CallableStatement will be used to issue this SQL, so users must make
sure that these calls are escaped properly. Usually this means that
calls must be enclosed by curly braces '{}' e.g. {call myprocedure}.
If this is false, then it's assumed that a regular sql statement is
being passed in.
NOTE: When using a stored procedure, the expected return value is a
valid single ResultSet
a
- RepositoryException if the arguments are incorrect
RepositoryException
protected Query constantQuery(boolean pValue)
public java.lang.String format(java.lang.String pMsgKey, java.lang.Object[] pArgs)
pMsgKey
- message id to formatpArgs
- arguments to fill in in messagepublic java.lang.String format(java.lang.String pMsgKey)
public java.lang.String format(java.lang.String pMsgKey, java.lang.Object pArg)
public java.lang.String format(java.lang.String pMsgKey, java.lang.Object pArg1, java.lang.Object pArg2)
public java.lang.String toString()
toString
in class java.lang.Object
public Query rebuild(Query pQuery, atg.repository.dp.TranslationContext pContext) throws RepositoryException
rebuild
in interface atg.repository.dp.DerivedPropertyQueryBuilder
pQuery
- the query to rebuild, which must have been built by this
query builderpContext
- translation context to use for this rebuild
RepositoryException
- if pQuery is invalid or could not be builtpublic ApplicationLogging getLogger()
getLogger
in interface atg.repository.dp.DerivedPropertyQueryBuilder
public Query addContextMembershipFilters(Query pQuery, atg.repository.ContextFilteringRules pRules) throws RepositoryException
QueryBuilder
addContextMembershipFilters
in interface QueryBuilder
pQuery
- The query to which constraints are to be added.pRules
- The ContextFilteringRules to use for generating the filters
RepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |