|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.jpa.conf.EntityMapLoader
public class EntityMapLoader
Loads JPA mapping information from all sources per JPA specification.
The set of managed persistence classes that are managed by a persistence unit is defined by using one or more of the following:
The result is undefined if multiple mapping files (including any orm.xml file) referenced within a single persistence unit contain overlapping mapping information for any given class.
The resulting set of entities managed by the persistence unit [and contained in the returned entity map] is the union of these sources, with the mapping metadata annotations (or annotation defaults) for any given class being overridden by the XML mapping information file if there are both annotations as well as XML mappings for that class. The minimum portable level of overriding is at the level of the persistent field or property.
Field Summary | |
---|---|
protected EntityMapLoaderContext |
context
|
protected Map<String,JpaClassDescriptor> |
descriptors
|
Constructor Summary | |
---|---|
EntityMapLoader(PersistenceUnitInfo persistenceUnit)
Creates an EntityMapLoader for the persistence unit, merging entity information from all locations supported by the JPA specification. |
Method Summary | |
---|---|
EntityMapLoaderContext |
getContext()
|
JpaEntityMap |
getEntityMap()
Returns an entity map with entity |
protected void |
loadEntityMap(PersistenceUnitInfo persistenceUnit)
Loads a combined entity map including managed class descriptors from all supported locations. |
protected void |
loadFromAnnotations(PersistenceUnitInfo persistenceUnit)
Loads JpaEntityMap based on metadata annotations of persistent classes. |
protected void |
updateFromDefaults()
Updates missing values with spec-compilant defaults. |
protected void |
updateFromXML(PersistenceUnitInfo unit)
Updates mapping with data loaded from XML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected EntityMapLoaderContext context
protected Map<String,JpaClassDescriptor> descriptors
Constructor Detail |
---|
public EntityMapLoader(PersistenceUnitInfo persistenceUnit)
Method Detail |
---|
public JpaEntityMap getEntityMap()
protected void loadEntityMap(PersistenceUnitInfo persistenceUnit) throws JpaProviderException
JpaProviderException
protected void updateFromDefaults()
protected void updateFromXML(PersistenceUnitInfo unit) throws IOException
An orm.xml file may be specified in the META-INF directory in the root of the persistence unit or in the META-INF directory of any jar file referenced by the persistence.xml. Alternatively, or in addition, other mapping files maybe referenced by the mapping-file elements of the persistence-unit element, and may be present anywhere on the classpath. An orm.xml file or other mapping file is loaded as a resource by the persistence provider.
IOException
protected void loadFromAnnotations(PersistenceUnitInfo persistenceUnit)
public EntityMapLoaderContext getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |