Package org.nuxeo.ecm.platform.tag
Class TagQueryMaker
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker
-
- org.nuxeo.ecm.platform.tag.TagQueryMaker
-
- All Implemented Interfaces:
QueryMaker
public class TagQueryMaker extends NXQLQueryMaker
Query Maker specialized for tagging queries that need joins.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker
NXQLQueryMaker.ColumnInfo, NXQLQueryMaker.DocKind, NXQLQueryMaker.QueryAnalyzer, NXQLQueryMaker.WhereBuilder
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.jdbc.QueryMaker
QueryMaker.Query, QueryMaker.QueryCannotMatchException
-
-
Field Summary
Fields Modifier and Type Field Description static String
COUNT_SOURCE
Adds a COUNT() on the relation source, to count documents.protected Column
firstSelectedColumn
static String
NXTAG
The NXTAG query type.static String
PROPERTY_SOURCE
static String
PROPERTY_TARGET
protected Table
relationTable
static String
SCHEMA_RELATION
static String
SCHEMA_TAG
static String
TAG_IS_TARGET
Makes sure the Tag table is joined with the relation target instead of the hierarchy id.protected String
type
-
Fields inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker
AGGREGATE_FUNCTIONS, aliases, aliasesByName, AVG_FUNCTION, COL_ALIAS_PREFIX, COUNT_FUNCTION, database, dataHierTable, DATE_CAST, dialect, ECM_SIMPLE_ACP_BEGIN, ECM_SIMPLE_ACP_CREATOR, ECM_SIMPLE_ACP_END, ECM_SIMPLE_ACP_GRANT, ECM_SIMPLE_ACP_NAME, ECM_SIMPLE_ACP_PERMISSION, ECM_SIMPLE_ACP_POS, ECM_SIMPLE_ACP_PRINCIPAL, ECM_SIMPLE_ACP_STATUS, ECM_TAG_STAR, FACETED_TAG, FACETED_TAG_LABEL, fragJoinCount, HAS_FINAL_WILDCARD_INDEX, HAS_WILDCARD_INDEX, hierTable, INDEX, INDEX_SLASH, joins, model, neverPerInstanceMixins, NON_CANON_INDEX, pathResolver, propertyFragmentTables, proxyClause, proxyClauseReason, proxyTable, READ_ACL_ALIAS, READ_ACL_USER_MAP_ALIAS, RELATION_TABLE, selectCollectionNotNull, sqlInfo, SUBQUERY_ARRAY_ALIAS, TABLE_FRAG_ALIAS, TABLE_HIER_ALIAS, TYPE_DOCUMENT, TYPE_RELATION, TYPE_TAGGING, UNION_ALIAS, whereClauses, whereParams, WITH_ALIAS_PREFIX
-
-
Constructor Summary
Constructors Constructor Description TagQueryMaker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(String queryType)
Checks if this query maker accepts a given query.protected void
addJoin(int kind, String alias, Table table, String column, Table contextTable, String contextColumn, String name, int index, String primaryType)
Patches the Tag join to join on the relation target instead of the hierarchy id.QueryMaker.Query
buildQuery(SQLInfo sqlInfo, Model model, Session.PathResolver pathResolver, String query, QueryFilter queryFilter, Object... params)
Builds the query.protected void
fixInitialJoins()
Adds an initial join on the Relation table, and records it.protected void
fixSelect(Select select)
protected void
fixWhatColumns(List<Column> whatColumns)
String
getName()
Gets the name for this query maker.protected String
getSelectColName(Column col)
-
Methods inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker
canonicalXPath, findFulltextIndexOrField, getFragmentTable, getFragmentTable, getSelectColName, getSerializableLiteral, getSerializableLiterals, getStringLiterals, hasFinalWildcardIndex, hasWildcardIndex, keyForPos, newQueryAnalyzer, newWhereBuilder, simpleXPath
-
-
-
-
Field Detail
-
NXTAG
public static final String NXTAG
The NXTAG query type.- See Also:
- Constant Field Values
-
SCHEMA_TAG
public static final String SCHEMA_TAG
- See Also:
- Constant Field Values
-
SCHEMA_RELATION
public static final String SCHEMA_RELATION
- See Also:
- Constant Field Values
-
PROPERTY_SOURCE
public static final String PROPERTY_SOURCE
- See Also:
- Constant Field Values
-
PROPERTY_TARGET
public static final String PROPERTY_TARGET
- See Also:
- Constant Field Values
-
TAG_IS_TARGET
public static final String TAG_IS_TARGET
Makes sure the Tag table is joined with the relation target instead of the hierarchy id.- See Also:
- Constant Field Values
-
COUNT_SOURCE
public static final String COUNT_SOURCE
Adds a COUNT() on the relation source, to count documents.- See Also:
- Constant Field Values
-
type
protected String type
-
relationTable
protected Table relationTable
-
firstSelectedColumn
protected Column firstSelectedColumn
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:QueryMaker
Gets the name for this query maker.- Specified by:
getName
in interfaceQueryMaker
- Overrides:
getName
in classNXQLQueryMaker
-
accepts
public boolean accepts(String queryType)
Description copied from interface:QueryMaker
Checks if this query maker accepts a given query.Called first.
- Specified by:
accepts
in interfaceQueryMaker
- Overrides:
accepts
in classNXQLQueryMaker
- Parameters:
queryType
- the query- Returns:
true
if the query is accepted
-
buildQuery
public QueryMaker.Query buildQuery(SQLInfo sqlInfo, Model model, Session.PathResolver pathResolver, String query, QueryFilter queryFilter, Object... params)
Description copied from interface:QueryMaker
Builds the query.- Specified by:
buildQuery
in interfaceQueryMaker
- Overrides:
buildQuery
in classNXQLQueryMaker
- Parameters:
sqlInfo
- the sql infomodel
- the modelpathResolver
- the path resolverquery
- the queryqueryFilter
- the query filterparams
- additional parameters, maker-specific
-
fixInitialJoins
protected void fixInitialJoins()
Adds an initial join on the Relation table, and records it.- Overrides:
fixInitialJoins
in classNXQLQueryMaker
-
addJoin
protected void addJoin(int kind, String alias, Table table, String column, Table contextTable, String contextColumn, String name, int index, String primaryType)
Patches the Tag join to join on the relation target instead of the hierarchy id.- Overrides:
addJoin
in classNXQLQueryMaker
-
getSelectColName
protected String getSelectColName(Column col)
- Overrides:
getSelectColName
in classNXQLQueryMaker
-
fixWhatColumns
protected void fixWhatColumns(List<Column> whatColumns)
- Overrides:
fixWhatColumns
in classNXQLQueryMaker
-
fixSelect
protected void fixSelect(Select select)
- Overrides:
fixSelect
in classNXQLQueryMaker
-
-