Class RelationSchemaManagement
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<SET,TET>>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement<ResourceSchemaManagement,T,org.gcube.informationsystem.types.reference.entities.ResourceSchema,TT>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.types.relations.AbstractRelationSchemaManagement<EntitySchemaManagement,org.gcube.informationsystem.types.reference.entities.EntitySchema>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.types.relations.RelationSchemaManagement
- All Implemented Interfaces:
TypeDefinitionManagement
public class RelationSchemaManagement
extends AbstractRelationSchemaManagement<EntitySchemaManagement,org.gcube.informationsystem.types.reference.entities.EntitySchema>
Manages the type-definition record of
Relation itself, the organizational level of the
model that IsRelatedTo and ConsistsOf both extend and from which they inherit
the structural fields every instance carries.
Its target is Entity, the widest one a relation can point at, matching the model
declaration Relation<S extends Resource, T extends Entity>.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.types.relations.AbstractRelationSchemaManagement
nameFields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement
IN, includeSource, includeTarget, OUT, sourceEntityClass, sourceEntityManagement, targetEntityClass, targetEntityManagementFields inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement
accessType, affectedInstances, AT, cachedType, complete, DELETED, DOLLAR, dryRun, element, elementClass, entryPoint, ignoredFields, ignoreKeys, ignoreStartWithKeys, jsonNode, limit, logger, maskMetadata, metadataPolicy, oClass, oDatabaseDocument, offset, operation, polymorphic, preservePassedMetadata, reload, sanityCheckDeferred, self, typeName, UNDERSCORE, updateMode, uuid, workingEnvironment -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, uninitializedRelationSchemaManagementinstance.RelationSchemaManagement(TypeEnvironment typeEnvironment, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Creates a newRelationSchemaManagementinstance bound to the specified environment and database session. -
Method Summary
Modifier and TypeMethodDescriptionprotected EntitySchemaManagementCreates a new management instance for the target entity of the relation (subclass hook).voidPerforms runtime validation of the schema constraints this service enforces from the definition rather than through OrientDB: the mandatory properties, and theminandmaxbounds of the numeric values a creation or an update wrote.Methods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.types.relations.AbstractRelationSchemaManagement
checksourceAndTargetEntityCompliancy, createCompleteJsonNode, getAffectedInstances, getElement, getName, getSpecificAlreadyPresentException, getSpecificNotFoundException, getWorkingEnvironment, newSourceEntityManagement, reallyCreate, reallyDelete, reallyGetAll, reallyUpdate, retrieveElement, setNameMethods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement
carriesContent, getSourceEntityManagement, getSubmittedEndpoint, getSubmittedSourceReference, getTargetEntityManagement, includeSource, includeTarget, setSourceEntityManagement, setTargetEntityManagement, writeTargetMethods inherited from class org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement
addIgnoredFields, afterModification, all, applyPrivacyMask, applyPrivacyMask, checkERMatch, checkJsonNode, checkUUIDMatch, checkUUIDNotAlreadyInUse, cleanCachedSerialization, concludeTransaction, create, createOrUpdate, createOrUpdateElementWithResult, delete, exists, getAccessType, getAllProperties, getCachedType, getCurrentODatabaseDocumentFromThreadLocal, getIgnoredFields, getLimit, getMandatoryErrorMessage, getMandatoryErrorMessage, getMetadataPolicy, getOClass, getOffset, getPropertyForJson, getPropertyMap, getTypeName, getUpdateMode, getUUID, internalCreate, internalCreateOrUdate, internalDelete, internalUpdate, isBackendLinkFieldName, isDryRun, isMaskMetadata, isPolymorphic, isPreservePassedMetadata, isReload, isSanityCheckDeferred, read, recordModification, requireExplicitUUID, retrieveElementFromAnyContext, serializeAsAffectedInstance, serializeAsEndpointReference, serializeAsJsonNode, serializeSelfAsJsonNode, setAsEntryPoint, setDryRun, setElement, setElementType, setIgnoredFields, setJson, setJsonNode, setLimit, setMaskMetadata, setMetadataPolicy, setOClass, setODatabaseDocument, setOffset, setOperation, setPolymorphic, setPreservePassedMetadata, setProperty, setReload, setRequireExplicitUUID, setSanityCheckDeferred, setUpdateMode, setUUID, setWorkingEnvironment, typeSatified, update, updateProperties
-
Constructor Details
-
RelationSchemaManagement
public RelationSchemaManagement()Creates a new, uninitializedRelationSchemaManagementinstance. -
RelationSchemaManagement
public RelationSchemaManagement(TypeEnvironment typeEnvironment, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a newRelationSchemaManagementinstance bound to the specified environment and database session.- Parameters:
typeEnvironment- the Type environment to useoDatabaseDocument- the active OrientDB database session- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if initialization fails
-
-
Method Details
-
newTargetEntityManagement
protected EntitySchemaManagement newTargetEntityManagement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionDescription copied from class:RelationElementManagementCreates a new management instance for the target entity of the relation (subclass hook).- Specified by:
newTargetEntityManagementin classRelationElementManagement<ResourceSchemaManagement,EntitySchemaManagement, org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.EntitySchema> - Returns:
- the target entity management instance
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database or lookup error
-
sanityCheck
public void sanityCheck() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionDescription copied from class:ElementManagementPerforms runtime validation of the schema constraints this service enforces from the definition rather than through OrientDB: the mandatory properties, and theminandmaxbounds of the numeric values a creation or an update wrote.- Overrides:
sanityCheckin classElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema, org.gcube.informationsystem.types.reference.entities.EntitySchema>> - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException- if a schema constraint is violatedorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database lookup failure
-