Package org.nuxeo.ecm.core.storage.sql
Class Model
java.lang.Object
org.nuxeo.ecm.core.storage.sql.Model
The
Model
is the link between high-level types and SQL-level objects (entity tables, collections). It defines
all policies relating to the choice of structure (what schema are grouped together in for optimization) and names in
the SQL database (table names, column names), and to what entity names (type name, field name) they correspond.
A Nuxeo schema or type is mapped to a SQL-level table. Several types can be aggregated in the same table. In theory, a type could even be split into different tables.
- Author:
- Florent Guillaume
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Type of ids as seen by the VCS Java layer. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Map of doctype to prefetched fragments.Map of doctype to its subtypes (including itself), for search.Map of doctype to its supertype, for search.Map of doctype to mixins, for search.static final String
Specified in ext. point to use array instead of collection table.static final String
Specified in ext. point to use CLOB array instead of collection table.static final String
Specified in ext. point to use CLOBs.Map of field name to fragment holding it.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final FulltextConfiguration
protected final Map<String,
PropertyType> Map of fragment -> info about whether there's a fulltext text field (PropertyType.STRING), binary field (PropertyType.BINARY), or both (PropertyType.BOOLEAN).static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final Type
protected final PropertyType
protected final Model.IdType
static final Long
static final Long
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Deprecated.since 11.1static final String
Deprecated.since 11.1static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final boolean
If true, the misc columns are added to hierarchy, not to a separate misc table.Map of mixin to child name to type.Map of mixin to simple+collection fragments.static final Long
protected final boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected final RepositoryDescriptor
static final String
Map of schema to child name to type.protected final boolean
Map of doctype/complextype to child name to type.Map of doctype/complextype to simple+collection fragments.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
checkReservedName
(String key) getCollectionFragmentType
(String fragmentName) getCollectionOrderBy
(String fragmentName) getDocumentSubTypes
(String typeName) getDocumentSuperType
(String typeName) getDocumentTypeFacets
(String typeName) getFragmentKeysType
(String fragmentName) getFulltextFieldType
(String fragmentName, String fragmentKey) Finds out if a field is to be indexed as fulltext.getFulltextIndexSuffix
(String indexName) getFulltextInfoForFragment
(String fragmentName) Checks if a fragment has any field indexable as fulltext.getMixinComplexChildren
(String mixin) getMixinDocumentTypes
(String mixin) getMixinPropertyInfo
(String mixin, String propertyName) getMixinPropertyInfos
(String mixin) getPathPropertyInfo
(String xpath) Gets the model of the property for the given path.getPathPropertyInfo
(String primaryType, String[] mixinTypes, String path) getPerFragmentIds
(Map<Serializable, RowMapper.IdWithTypes> idToTypes) Given a map of id to types, returns a map of fragment names to ids.getPropertyInfo
(String propertyName) getPropertyInfo
(String typeName, String propertyName) Get doctype/complextype property info.getProxySchemasPropertyInfo
(String propertyName) Gets the repository descriptor used for this model.getSimpleTextPropertyPaths
(String primaryType, String[] mixinTypes) getSpecialPropertyType
(String propertyName) getTypeComplexChildren
(String typeName) getTypeFragments
(RowMapper.IdWithTypes typeInfo) Gets the type fragments for a primary type and mixin types.getTypePrefetchedFragments
(String typeName) idFromString
(String id) Fixup an id that has been turned into a string for high-level Nuxeo APIs.Turns an id that may be a String or a Long into a String for high-level Nuxeo APIs.boolean
isCollectionFragment
(String fragmentName) boolean
isProxySchemaPath
(String xpath) Checks if the given xpath, when resolved on a proxy, points to a proxy-specific schema instead of the target document.boolean
Checks if we have a type (doctype or complex type).
-
Field Details
-
ROOT_TYPE
- See Also:
-
REPOINFO_TABLE_NAME
- See Also:
-
REPOINFO_REPONAME_KEY
- See Also:
-
MAIN_KEY
- See Also:
-
CLUSTER_NODES_TABLE_NAME
- See Also:
-
CLUSTER_NODES_NODEID_KEY
- See Also:
-
CLUSTER_NODES_CREATED_KEY
- See Also:
-
CLUSTER_INVALS_TABLE_NAME
- See Also:
-
CLUSTER_INVALS_NODEID_KEY
- See Also:
-
CLUSTER_INVALS_ID_KEY
- See Also:
-
CLUSTER_INVALS_FRAGMENTS_KEY
- See Also:
-
CLUSTER_INVALS_KIND_KEY
- See Also:
-
MAIN_PRIMARY_TYPE_PROP
- See Also:
-
MAIN_PRIMARY_TYPE_KEY
- See Also:
-
MAIN_MIXIN_TYPES_PROP
- See Also:
-
MAIN_MIXIN_TYPES_KEY
- See Also:
-
MAIN_IS_RECORD_PROP
- Since:
- 11.1
- See Also:
-
MAIN_IS_FLEXIBLE_RECORD_PROP
- Since:
- 2023.1
- See Also:
-
MAIN_IS_RECORD_KEY
- Since:
- 11.1
- See Also:
-
MAIN_IS_FLEXIBLE_RECORD_KEY
- Since:
- 2023.1
- See Also:
-
MAIN_RETAINED_PROPS_PROP
- Since:
- 2021.32
- See Also:
-
MAIN_RETAINED_PROPS_KEY
- Since:
- 2021.32
- See Also:
-
MAIN_RETAIN_UNTIL_PROP
- Since:
- 11.1
- See Also:
-
MAIN_RETAIN_UNTIL_KEY
- Since:
- 11.1
- See Also:
-
MAIN_HAS_LEGAL_HOLD_PROP
- Since:
- 11.1
- See Also:
-
MAIN_HAS_LEGAL_HOLD_KEY
- Since:
- 11.1
- See Also:
-
MAIN_IS_RETENTION_ACTIVE_PROP
Deprecated.since 11.1- See Also:
-
MAIN_IS_RETENTION_ACTIVE_KEY
Deprecated.since 11.1- See Also:
-
MAIN_BASE_VERSION_PROP
- See Also:
-
MAIN_BASE_VERSION_KEY
- See Also:
-
MAIN_CHECKED_IN_PROP
- See Also:
-
MAIN_CHECKED_IN_KEY
- See Also:
-
MAIN_MAJOR_VERSION_PROP
- See Also:
-
MAIN_MAJOR_VERSION_KEY
- See Also:
-
MAIN_MINOR_VERSION_PROP
- See Also:
-
MAIN_MINOR_VERSION_KEY
- See Also:
-
MAIN_IS_VERSION_PROP
- See Also:
-
MAIN_IS_VERSION_KEY
- See Also:
-
MAIN_SYS_CHANGE_TOKEN_PROP
- See Also:
-
MAIN_SYS_CHANGE_TOKEN_KEY
- See Also:
-
MAIN_CHANGE_TOKEN_PROP
- See Also:
-
MAIN_CHANGE_TOKEN_KEY
- See Also:
-
MAIN_IS_DELETED_PROP
- See Also:
-
MAIN_IS_DELETED_KEY
- See Also:
-
MAIN_DELETED_TIME_PROP
- See Also:
-
MAIN_DELETED_TIME_KEY
- See Also:
-
MAIN_IS_TRASHED_PROP
- Since:
- 10.1
- See Also:
-
MAIN_IS_TRASHED_KEY
- Since:
- 10.1
- See Also:
-
UID_SCHEMA_NAME
- See Also:
-
UID_MAJOR_VERSION_KEY
- See Also:
-
UID_MINOR_VERSION_KEY
- See Also:
-
HIER_TABLE_NAME
- See Also:
-
HIER_PARENT_KEY
- See Also:
-
HIER_CHILD_NAME_KEY
- See Also:
-
HIER_CHILD_POS_KEY
- See Also:
-
HIER_CHILD_ISPROPERTY_KEY
- See Also:
-
ANCESTORS_TABLE_NAME
- See Also:
-
ANCESTORS_ANCESTOR_KEY
- See Also:
-
COLL_TABLE_POS_KEY
- See Also:
-
COLL_TABLE_VALUE_KEY
- See Also:
-
MISC_TABLE_NAME
- See Also:
-
MISC_LIFECYCLE_POLICY_PROP
- See Also:
-
MISC_LIFECYCLE_POLICY_KEY
- See Also:
-
MISC_LIFECYCLE_STATE_PROP
- See Also:
-
MISC_LIFECYCLE_STATE_KEY
- See Also:
-
ACL_TABLE_NAME
- See Also:
-
ACL_PROP
- See Also:
-
ACL_POS_KEY
- See Also:
-
ACL_NAME_KEY
- See Also:
-
ACL_GRANT_KEY
- See Also:
-
ACL_PERMISSION_KEY
- See Also:
-
ACL_CREATOR_KEY
- See Also:
-
ACL_BEGIN_KEY
- See Also:
-
ACL_END_KEY
- See Also:
-
ACL_STATUS_KEY
- See Also:
-
ACL_USER_KEY
- See Also:
-
ACL_GROUP_KEY
- See Also:
-
VERSION_TABLE_NAME
- See Also:
-
VERSION_VERSIONABLE_PROP
- See Also:
-
VERSION_VERSIONABLE_KEY
- See Also:
-
VERSION_CREATED_PROP
- See Also:
-
VERSION_CREATED_KEY
- See Also:
-
VERSION_LABEL_PROP
- See Also:
-
VERSION_LABEL_KEY
- See Also:
-
VERSION_DESCRIPTION_PROP
- See Also:
-
VERSION_DESCRIPTION_KEY
- See Also:
-
VERSION_IS_LATEST_PROP
- See Also:
-
VERSION_IS_LATEST_KEY
- See Also:
-
VERSION_IS_LATEST_MAJOR_PROP
- See Also:
-
VERSION_IS_LATEST_MAJOR_KEY
- See Also:
-
PROXY_TYPE
- See Also:
-
PROXY_TABLE_NAME
- See Also:
-
PROXY_TARGET_PROP
- See Also:
-
PROXY_TARGET_KEY
- See Also:
-
PROXY_VERSIONABLE_PROP
- See Also:
-
PROXY_VERSIONABLE_KEY
- See Also:
-
LOCK_TABLE_NAME
- See Also:
-
LOCK_OWNER_PROP
- See Also:
-
LOCK_OWNER_KEY
- See Also:
-
LOCK_CREATED_PROP
- See Also:
-
LOCK_CREATED_KEY
- See Also:
-
FULLTEXT_DEFAULT_INDEX
- See Also:
-
FULLTEXT_TABLE_NAME
- See Also:
-
FULLTEXT_JOBID_PROP
- See Also:
-
FULLTEXT_JOBID_KEY
- See Also:
-
FULLTEXT_FULLTEXT_PROP
- See Also:
-
FULLTEXT_FULLTEXT_KEY
- See Also:
-
FULLTEXT_SIMPLETEXT_PROP
- See Also:
-
FULLTEXT_SIMPLETEXT_KEY
- See Also:
-
FULLTEXT_BINARYTEXT_PROP
- See Also:
-
FULLTEXT_BINARYTEXT_KEY
- See Also:
-
HIER_READ_ACL_TABLE_NAME
- See Also:
-
HIER_READ_ACL_ID
- See Also:
-
HIER_READ_ACL_ACL_ID
- See Also:
-
ACLR_USER_MAP_TABLE_NAME
- See Also:
-
ACLR_USER_MAP_USER_ID
- See Also:
-
ACLR_USER_MAP_ACL_ID
- See Also:
-
FIELD_TYPE_LARGETEXT
Specified in ext. point to use CLOBs.- See Also:
-
FIELD_TYPE_ARRAY
Specified in ext. point to use array instead of collection table.- See Also:
-
FIELD_TYPE_ARRAY_LARGETEXT
Specified in ext. point to use CLOB array instead of collection table.- See Also:
-
NO_SUCH_LONG_ID
-
INITIAL_CHANGE_TOKEN
-
INITIAL_SYS_CHANGE_TOKEN
-
softDeleteEnabled
protected final boolean softDeleteEnabled -
proxiesEnabled
protected final boolean proxiesEnabled -
changeTokenEnabled
protected final boolean changeTokenEnabled -
idType
-
idPropertyType
-
idCoreType
-
miscInHierarchy
protected final boolean miscInHierarchyIf true, the misc columns are added to hierarchy, not to a separate misc table. -
repositoryDescriptor
-
documentTypesMixins
Map of doctype to mixins, for search. -
typeFragments
Map of doctype/complextype to simple+collection fragments. -
mixinFragments
Map of mixin to simple+collection fragments. -
docTypePrefetchedFragments
Map of doctype to prefetched fragments. -
schemaComplexChildren
Map of schema to child name to type. -
typeComplexChildren
Map of doctype/complextype to child name to type. -
mixinComplexChildren
Map of mixin to child name to type. -
documentSuperTypes
Map of doctype to its supertype, for search. -
documentSubTypes
Map of doctype to its subtypes (including itself), for search. -
fieldFragment
Map of field name to fragment holding it. Used for prefetch. -
fulltextConfiguration
-
noPerDocumentQueryFacets
-
fulltextInfoByFragment
Map of fragment -> info about whether there's a fulltext text field (PropertyType.STRING), binary field (PropertyType.BINARY), or both (PropertyType.BOOLEAN).
-
-
Constructor Details
-
Model
-
-
Method Details
-
getRepositoryDescriptor
Gets the repository descriptor used for this model.- Returns:
- the repository descriptor
-
idFromString
Fixup an id that has been turned into a string for high-level Nuxeo APIs.- Parameters:
id
- the id to fixup- Returns:
- the fixed up id
-
idToString
Turns an id that may be a String or a Long into a String for high-level Nuxeo APIs.- Parameters:
id
- the serializable id- Returns:
- the string
-
getPropertyInfo
Get doctype/complextype property info. -
getMixinPropertyInfos
-
getProxySchemasPropertyInfo
-
getMixinPropertyInfo
-
getPropertyInfo
-
getPathPropertyInfo
Gets the model of the property for the given path. Returns something withModelProperty.isIntermediateSegment()
= true for an intermediate segment of a complex property. -
getPropertyInfoNames
-
getPathPropertyInfo
-
getTypeComplexChildren
-
getMixinComplexChildren
-
getSimpleTextPropertyPaths
-
isProxySchemaPath
Checks if the given xpath, when resolved on a proxy, points to a proxy-specific schema instead of the target document. -
getFulltextConfiguration
-
getFulltextFieldType
Finds out if a field is to be indexed as fulltext.- Parameters:
fragmentKey
- the key ornull
for a collection- Returns:
PropertyType.STRING
orPropertyType.BINARY
if this field is to be indexed as fulltext
-
getFulltextInfoForFragment
Checks if a fragment has any field indexable as fulltext.- Returns:
- PropertyType.STRING, PropertyType.BINARY, or PropertyType.BOOLEAN for both.
-
getSpecialPropertyType
-
getCollectionFragmentType
-
isCollectionFragment
-
getCollectionOrderBy
-
getFragmentNames
-
getFragmentKeysType
-
getBinaryPropertyInfos
-
getTypePrefetchedFragments
-
isType
Checks if we have a type (doctype or complex type). -
getDocumentSuperType
-
getDocumentSubTypes
-
getDocumentTypes
-
getDocumentTypeFacets
-
getMixinDocumentTypes
-
getPerFragmentIds
public Map<String,Set<Serializable>> getPerFragmentIds(Map<Serializable, RowMapper.IdWithTypes> idToTypes) Given a map of id to types, returns a map of fragment names to ids. -
getTypeFragments
Gets the type fragments for a primary type and mixin types. Hierarchy is included. -
getNoPerDocumentQueryFacets
-
getFulltextIndexSuffix
-
checkReservedName
-