Class CMISQLtoNXQL
- java.lang.Object
-
- org.nuxeo.ecm.core.opencmis.impl.server.CMISQLtoNXQL
-
public class CMISQLtoNXQL extends Object
Transformer of CMISQL queries into NXQL queries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CMISQLtoNXQL.AnalyzingWalker
Walker of the WHERE clause that doesn't parse fulltext expressions.class
CMISQLtoNXQL.GeneratingWalker
Walker of the WHERE clause that generates NXQL.static class
CMISQLtoNXQL.NXQLtoCMISIterableQueryResult
IterableQueryResult wrapping the one from the NXQL query to turn values into CMIS ones.
-
Field Summary
Fields Modifier and Type Field Description protected static String
CMIS_PREFIX
protected CoreSession
coreSession
protected org.apache.chemistry.opencmis.commons.definitions.TypeDefinition
fromType
protected boolean
hasContains
protected static String
JOIN
protected static Set<String>
NULL_IS_FALSE_COLUMNS
protected static String
NX_PREFIX
protected static String
NXQL_DC_CREATED
protected static String
NXQL_DC_CREATOR
protected static String
NXQL_DC_DESCRIPTION
protected static String
NXQL_DC_LAST_CONTRIBUTOR
protected static String
NXQL_DC_MODIFIED
protected static String
NXQL_DC_TITLE
protected static String
NXQL_DOCUMENT
protected static String
NXQL_REL_SOURCE
protected static String
NXQL_REL_TARGET
protected static String
NXQL_RELATION
protected static String
ORDER_BY
protected org.apache.chemistry.opencmis.server.support.query.QueryObject
query
protected org.apache.chemistry.opencmis.server.support.query.QueryUtilStrict
queryUtil
protected Map<String,String>
realColumns
The real columns, CMIS name mapped to NXQL.protected boolean
skipDeleted
protected boolean
supportsProxies
protected Map<String,org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>>
typeInfo
protected Map<String,org.apache.chemistry.opencmis.server.support.query.ColumnReference>
virtualColumns
The non-real-columns we'll return as well.protected static String
WHERE
-
Constructor Summary
Constructors Constructor Description CMISQLtoNXQL(boolean supportsProxies)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addSystemColumns()
protected static String
cmisToNxqlFulltextQuery(String statement)
protected String
convertOrderBy(String orderBy, TypeManagerImpl typeManager)
Convert an ORDER BY part from CMISQL to NXQL.PartialList<Map<String,Serializable>>
convertToCMIS(PartialList<Map<String,Serializable>> pl, NuxeoCmisService service)
protected static Map<String,Serializable>
convertToCMISMap(Map<String,Serializable> nxqlMap, Map<String,String> realColumns, Map<String,org.apache.chemistry.opencmis.server.support.query.ColumnReference> virtualColumns, NuxeoCmisService service)
protected String
getColumn(String propertyId)
Finds a NXQL column from a CMIS reference.protected String
getColumn(org.apache.chemistry.opencmis.server.support.query.ColumnReference col)
Finds a NXQL column from a CMIS reference.IterableQueryResult
getIterableQueryResult(IterableQueryResult it, NuxeoCmisService service)
String
getNXQL(String cmisql, NuxeoCmisService service, Map<String,org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> typeInfo, boolean searchAllVersions)
Gets the NXQL from a CMISQL query.protected String
getSystemColumn(String propertyId)
Finds a NXQL system column from a CMIS system property id.protected boolean
isFacetsColumn(String name)
protected void
recordSelector(org.apache.chemistry.opencmis.server.support.query.CmisSelector sel, String clauseType)
Records a JOIN / WHERE / ORDER BY selector, and associates it to a database column.protected void
recordSelectSelector(org.apache.chemistry.opencmis.server.support.query.CmisSelector sel)
Records a SELECT selector, and associates it to a database column.
-
-
-
Field Detail
-
CMIS_PREFIX
protected static final String CMIS_PREFIX
- See Also:
- Constant Field Values
-
NX_PREFIX
protected static final String NX_PREFIX
- See Also:
- Constant Field Values
-
NXQL_DOCUMENT
protected static final String NXQL_DOCUMENT
- See Also:
- Constant Field Values
-
NXQL_RELATION
protected static final String NXQL_RELATION
- See Also:
- Constant Field Values
-
NXQL_DC_TITLE
protected static final String NXQL_DC_TITLE
- See Also:
- Constant Field Values
-
NXQL_DC_DESCRIPTION
protected static final String NXQL_DC_DESCRIPTION
- See Also:
- Constant Field Values
-
NXQL_DC_CREATOR
protected static final String NXQL_DC_CREATOR
- See Also:
- Constant Field Values
-
NXQL_DC_CREATED
protected static final String NXQL_DC_CREATED
- See Also:
- Constant Field Values
-
NXQL_DC_MODIFIED
protected static final String NXQL_DC_MODIFIED
- See Also:
- Constant Field Values
-
NXQL_DC_LAST_CONTRIBUTOR
protected static final String NXQL_DC_LAST_CONTRIBUTOR
- See Also:
- Constant Field Values
-
NXQL_REL_SOURCE
protected static final String NXQL_REL_SOURCE
- See Also:
- Constant Field Values
-
NXQL_REL_TARGET
protected static final String NXQL_REL_TARGET
- See Also:
- Constant Field Values
-
supportsProxies
protected final boolean supportsProxies
-
typeInfo
protected Map<String,org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> typeInfo
-
coreSession
protected CoreSession coreSession
-
queryUtil
protected org.apache.chemistry.opencmis.server.support.query.QueryUtilStrict queryUtil
-
query
protected org.apache.chemistry.opencmis.server.support.query.QueryObject query
-
fromType
protected org.apache.chemistry.opencmis.commons.definitions.TypeDefinition fromType
-
skipDeleted
protected boolean skipDeleted
-
hasContains
protected boolean hasContains
-
virtualColumns
protected Map<String,org.apache.chemistry.opencmis.server.support.query.ColumnReference> virtualColumns
The non-real-columns we'll return as well.
-
JOIN
protected static final String JOIN
- See Also:
- Constant Field Values
-
WHERE
protected static final String WHERE
- See Also:
- Constant Field Values
-
ORDER_BY
protected static final String ORDER_BY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNXQL
public String getNXQL(String cmisql, NuxeoCmisService service, Map<String,org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> typeInfo, boolean searchAllVersions) throws QueryParseException
Gets the NXQL from a CMISQL query.- Throws:
QueryParseException
-
getIterableQueryResult
public IterableQueryResult getIterableQueryResult(IterableQueryResult it, NuxeoCmisService service)
-
convertToCMIS
public PartialList<Map<String,Serializable>> convertToCMIS(PartialList<Map<String,Serializable>> pl, NuxeoCmisService service)
-
isFacetsColumn
protected boolean isFacetsColumn(String name)
-
addSystemColumns
protected void addSystemColumns()
-
recordSelectSelector
protected void recordSelectSelector(org.apache.chemistry.opencmis.server.support.query.CmisSelector sel)
Records a SELECT selector, and associates it to a database column.
-
recordSelector
protected void recordSelector(org.apache.chemistry.opencmis.server.support.query.CmisSelector sel, String clauseType)
Records a JOIN / WHERE / ORDER BY selector, and associates it to a database column.
-
getColumn
protected String getColumn(org.apache.chemistry.opencmis.server.support.query.ColumnReference col)
Finds a NXQL column from a CMIS reference.
-
getSystemColumn
protected String getSystemColumn(String propertyId)
Finds a NXQL system column from a CMIS system property id.
-
convertOrderBy
protected String convertOrderBy(String orderBy, TypeManagerImpl typeManager)
Convert an ORDER BY part from CMISQL to NXQL.- Since:
- 6.0
-
convertToCMISMap
protected static Map<String,Serializable> convertToCMISMap(Map<String,Serializable> nxqlMap, Map<String,String> realColumns, Map<String,org.apache.chemistry.opencmis.server.support.query.ColumnReference> virtualColumns, NuxeoCmisService service)
-
-