Package cz.cvut.kbss.jopa.loaders
Class PersistenceUnitClassFinder
java.lang.Object
cz.cvut.kbss.jopa.loaders.PersistenceUnitClassFinder
Scans classpath to discover classes relevant to persistence unit building.
Only classes under the package configured via JOPAPersistenceProperties.SCAN_PACKAGE
are processed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap<Class<?>,
ConverterWrapper<?, ?>> GetsAttributeConverter
implementations found during classpath scanning.Gets entity classes found during classpath scanning.GetsSparqlResultSetMapping
s found during classpath scanning.void
scanClasspath
(Configuration configuration) Scans application classpath based on theJOPAPersistenceProperties.SCAN_PACKAGE
, looking for classes relevant for the persistence provider.
-
Constructor Details
-
PersistenceUnitClassFinder
public PersistenceUnitClassFinder()
-
-
Method Details
-
scanClasspath
Scans application classpath based on theJOPAPersistenceProperties.SCAN_PACKAGE
, looking for classes relevant for the persistence provider.These classes include:
- Entities, i.e. classes annotated with
OWLClass
, - Result result mapping classes, i.e. classes annotated with
SparqlResultSetMapping
orSparqlResultSetMappings
- Parameters:
configuration
- Persistence configuration, should contain value for theJOPAPersistenceProperties.SCAN_PACKAGE
property- Throws:
IllegalArgumentException
- IfJOPAPersistenceProperties.SCAN_PACKAGE
values is missing
- Entities, i.e. classes annotated with
-
getEntities
Gets entity classes found during classpath scanning.- Returns:
- Set of entity classes discovered on classpath
-
getResultSetMappings
GetsSparqlResultSetMapping
s found during classpath scanning.- Returns:
- Set of result set mapping annotations discovered on classpath
-
getAttributeConverters
GetsAttributeConverter
implementations found during classpath scanning.The converters are wrapped in an internal helper class
ConverterWrapper
.- Returns:
- Map of classes to custom converters
-