Class MetamodelImpl
- All Implemented Interfaces:
Metamodel
,MetamodelProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified URI to the module extraction signature.void
build
(PersistenceUnitClassFinder classFinder) Builds the metamodel for classes (entity classes, attribute converters etc.) discovered by the specifiedPersistenceUnitClassFinder
.void
Builds a reduced metamodel for the specified set of entity classes.<X> IdentifiableEntityType<X>
Return the metamodel entity type representing the entity.Set<EntityType<?>>
Return the metamodel entity types.<X> Class<? extends X>
getEntityReferenceProxy
(Class<X> cls) Gets aEntityReferenceProxy
type for the specified class.Get the set of classes that contain inferred attributes.<X> Class<? extends X>
getLazyLoadingProxy
(Class<X> cls) Gets aLazyLoadingProxy
type for the specified class.Set<ManagedType<?>>
Return the metamodel managed types.Set<EntityType<?>>
getMappedEntities
(String classIri) Returns the metamodel entity types representing the specified ontological class.Gets the metamodelGets a set of URIs that should be added to module extraction signature.GetsNamedQueryManager
for this persistence unit.Gets namespace resolver containing namespaces detected for this persistence unit.getReferringTypes
(Class<?> cls) Gets types which contain an attribute of the specified type.Gets the SPARQL result set mapping manager (ResultSetMappingManager
) for this persistence unit.boolean
isEntityType
(Class<?> cls) Checks whether the specified class is an entity type.
-
Constructor Details
-
MetamodelImpl
protected MetamodelImpl() -
MetamodelImpl
-
-
Method Details
-
build
Builds the metamodel for classes (entity classes, attribute converters etc.) discovered by the specifiedPersistenceUnitClassFinder
.- Parameters:
classFinder
- Finder of PU classes
-
build
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
Description copied from interface:Metamodel
Return the metamodel entity type representing the entity. -
getMappedEntities
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 interfaceMetamodel
- Parameters:
classIri
- Identifier of the ontological class- Returns:
- A set of entity types mapped to the specified class IRI, possibly empty
-
getEntities
Description copied from interface:Metamodel
Return the metamodel entity types.- Specified by:
getEntities
in interfaceMetamodel
- Returns:
- the metamodel entity types
-
getManagedTypes
Description copied from interface:Metamodel
Return the metamodel managed types.- Specified by:
getManagedTypes
in interfaceMetamodel
- Returns:
- the metamodel managed types
-
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 interfaceMetamodel
- Returns:
- The set of classes with inferred attributes.
-
getNamedQueryManager
Description copied from interface:MetamodelProvider
GetsNamedQueryManager
for this persistence unit.- Specified by:
getNamedQueryManager
in interfaceMetamodelProvider
- Returns:
NamedQueryManager
-
getResultSetMappingManager
Description copied from interface:MetamodelProvider
Gets the SPARQL result set mapping manager (ResultSetMappingManager
) for this persistence unit.- Specified by:
getResultSetMappingManager
in interfaceMetamodelProvider
- Returns:
ResultSetMappingManager
-
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 interfaceMetamodel
- Returns:
- A set of URIs
-
addUriToModuleExtractionSignature
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 interfaceMetamodel
- Parameters:
uri
- The URI to add
-
getMetamodel
Description copied from interface:MetamodelProvider
Gets the metamodel- Specified by:
getMetamodel
in interfaceMetamodelProvider
- Returns:
- Metamodel
-
isEntityType
Description copied from interface:MetamodelProvider
Checks whether the specified class is an entity type.- Specified by:
isEntityType
in interfaceMetamodelProvider
- Parameters:
cls
- The class to check- Returns:
- Whether type is managed
-
getReferringTypes
Gets types which contain an attribute of the specified type.- Parameters:
cls
- Type referred to- Returns:
- Set of referring types, possibly empty
-
getLazyLoadingProxy
Gets aLazyLoadingProxy
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
Gets aEntityReferenceProxy
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
Gets namespace resolver containing namespaces detected for this persistence unit.- Returns:
- NamespaceResolver
-