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)
  • Constructor Details

    • RelationSchemaManagement

      public RelationSchemaManagement()
      Creates a new, uninitialized RelationSchemaManagement instance.
    • RelationSchemaManagement

      public RelationSchemaManagement(TypeEnvironment typeEnvironment, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Creates a new RelationSchemaManagement instance bound to the specified environment and database session.
      Parameters:
      typeEnvironment - the Type environment to use
      oDatabaseDocument - 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.ResourceRegistryException
      Description copied from class: RelationElementManagement
      Creates a new management instance for the target entity of the relation (subclass hook).
      Specified by:
      newTargetEntityManagement in class RelationElementManagement<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.ResourceRegistryException
      Description copied from class: ElementManagement
      Performs runtime validation of the schema constraints this service enforces from the definition rather than through OrientDB: the mandatory properties, and the min and max bounds of the numeric values a creation or an update wrote.
      Overrides:
      sanityCheck in class ElementManagement<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 violated
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on database lookup failure