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<?, ?>> GetsAttributeConverterimplementations found during classpath scanning.Gets entity classes found during classpath scanning.GetsSparqlResultSetMappings found during classpath scanning.voidscanClasspath(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
SparqlResultSetMappingorSparqlResultSetMappings
- Parameters:
configuration- Persistence configuration, should contain value for theJOPAPersistenceProperties.SCAN_PACKAGEproperty- Throws:
IllegalArgumentException- IfJOPAPersistenceProperties.SCAN_PACKAGEvalues 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
GetsSparqlResultSetMappings found during classpath scanning.- Returns:
- Set of result set mapping annotations discovered on classpath
-
getAttributeConverters
GetsAttributeConverterimplementations found during classpath scanning.The converters are wrapped in an internal helper class
ConverterWrapper.- Returns:
- Map of classes to custom converters
-