Class MetamodelImpl

java.lang.Object
cz.cvut.kbss.jopa.model.MetamodelImpl
All Implemented Interfaces:
Metamodel, MetamodelProvider

public class MetamodelImpl extends Object implements Metamodel, MetamodelProvider
  • Constructor Details

    • MetamodelImpl

      protected MetamodelImpl()
    • MetamodelImpl

      public MetamodelImpl(Configuration configuration)
  • Method Details

    • build

      public void build(PersistenceUnitClassFinder classFinder)
      Builds the metamodel for classes (entity classes, attribute converters etc.) discovered by the specified PersistenceUnitClassFinder.
      Parameters:
      classFinder - Finder of PU classes
    • build

      public void build(Set<Class<?>> entityClasses)
      Builds a reduced metamodel for the specified set of entity classes.

      The result of calling this method is not equivalent to build(PersistenceUnitClassFinder) as it does not process result set mappings, attribute converters, named queries etc. It only builds metamodel for the specified entity classes.

      Also, no additional processing (like initializing static metamodel) is done.

      Parameters:
      entityClasses - Entity classes to initialize the metamodel with
    • entity

      public <X> IdentifiableEntityType<X> entity(Class<X> cls)
      Description copied from interface: Metamodel
      Return the metamodel entity type representing the entity.
      Specified by:
      entity in interface Metamodel
      Parameters:
      cls - the type of the represented entity
      Returns:
      the metamodel entity type
    • getMappedEntities

      public Set<EntityType<?>> getMappedEntities(String classIri)
      Description copied from interface: Metamodel
      Returns the metamodel entity types representing the specified ontological class.

      Note that since multiple entity types can be mapped to the same ontological class, this method returns a set of entity types instead of just one.

      Specified by:
      getMappedEntities in interface Metamodel
      Parameters:
      classIri - Identifier of the ontological class
      Returns:
      A set of entity types mapped to the specified class IRI, possibly empty
    • getEntities

      public Set<EntityType<?>> getEntities()
      Description copied from interface: Metamodel
      Return the metamodel entity types.
      Specified by:
      getEntities in interface Metamodel
      Returns:
      the metamodel entity types
    • getManagedTypes

      public Set<ManagedType<?>> getManagedTypes()
      Description copied from interface: Metamodel
      Return the metamodel managed types.
      Specified by:
      getManagedTypes in interface Metamodel
      Returns:
      the metamodel managed types
    • getInferredClasses

      public Set<Class<?>> getInferredClasses()
      Description copied from interface: Metamodel
      Get the set of classes that contain inferred attributes. These classes are handled specially since inferred attributes can be influenced by changes to any other attributes in any other entity.
      Specified by:
      getInferredClasses in interface Metamodel
      Returns:
      The set of classes with inferred attributes.
    • getNamedQueryManager

      public NamedQueryManager getNamedQueryManager()
      Description copied from interface: MetamodelProvider
      Gets NamedQueryManager for this persistence unit.
      Specified by:
      getNamedQueryManager in interface MetamodelProvider
      Returns:
      NamedQueryManager
    • getResultSetMappingManager

      public ResultSetMappingManager getResultSetMappingManager()
      Description copied from interface: MetamodelProvider
      Gets the SPARQL result set mapping manager (ResultSetMappingManager) for this persistence unit.
      Specified by:
      getResultSetMappingManager in interface MetamodelProvider
      Returns:
      ResultSetMappingManager
    • getModuleExtractionExtraSignature

      public Set<URI> getModuleExtractionExtraSignature()
      Description copied from interface: Metamodel
      Gets a set of URIs that should be added to module extraction signature.

      The returned collection is not modifiable.

      Specified by:
      getModuleExtractionExtraSignature in interface Metamodel
      Returns:
      A set of URIs
    • addUriToModuleExtractionSignature

      public void addUriToModuleExtractionSignature(URI uri)
      Description copied from interface: Metamodel
      Adds the specified URI to the module extraction signature.

      Note that a module including the specified URI will be created when a new resource level transaction is started. When that will be is implementation dependent. However it must be guaranteed that all subsequent connections provided by OntoDriver will include the URI in extracted modules.

      Specified by:
      addUriToModuleExtractionSignature in interface Metamodel
      Parameters:
      uri - The URI to add
    • getMetamodel

      public MetamodelImpl getMetamodel()
      Description copied from interface: MetamodelProvider
      Gets the metamodel
      Specified by:
      getMetamodel in interface MetamodelProvider
      Returns:
      Metamodel
    • isEntityType

      public boolean isEntityType(Class<?> cls)
      Description copied from interface: MetamodelProvider
      Checks whether the specified class is an entity type.
      Specified by:
      isEntityType in interface MetamodelProvider
      Parameters:
      cls - The class to check
      Returns:
      Whether type is managed
    • getReferringTypes

      public Set<Class<?>> getReferringTypes(Class<?> cls)
      Gets types which contain an attribute of the specified type.
      Parameters:
      cls - Type referred to
      Returns:
      Set of referring types, possibly empty
    • getLazyLoadingProxy

      public <X> Class<? extends X> getLazyLoadingProxy(Class<X> cls)
      Gets a LazyLoadingProxy type for the specified class.
      Type Parameters:
      X - Type to proxy
      Parameters:
      cls - Class to get lazy loading proxy for, should be an entity class
      Returns:
      Lazy loading proxy class
    • getEntityReferenceProxy

      public <X> Class<? extends X> getEntityReferenceProxy(Class<X> cls)
      Gets a EntityReferenceProxy type for the specified class.
      Type Parameters:
      X - Type to proxy
      Parameters:
      cls - Class to get reference proxy for, should be an entity class
      Returns:
      Entity proxy class
    • getNamespaceResolver

      public NamespaceResolver getNamespaceResolver()
      Gets namespace resolver containing namespaces detected for this persistence unit.
      Returns:
      NamespaceResolver