|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.orm.jpa.persistenceunit.PersistenceUnitReader
class PersistenceUnitReader
Internal helper class for reading persistence.xml files.
| Constructor Summary | |
|---|---|
PersistenceUnitReader(ResourcePatternResolver resourcePatternResolver,
DataSourceLookup dataSourceLookup)
Create a new PersistenceUnitReader. |
|
| Method Summary | |
|---|---|
protected URL |
determinePersistenceUnitRootUrl(Resource resource)
Determine the persistence unit root URL based on the given resource (which points to the persistence.xml file we're reading). |
protected Resource |
findSchemaResource(String schemaName)
Try to locate the schema first in the class path before using the URL specified inside the XML. |
protected void |
parseClass(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
Parse the class XML elements. |
protected List<SpringPersistenceUnitInfo> |
parseDocument(Resource resource,
Document document,
List<SpringPersistenceUnitInfo> infos)
Parse the validated document and populates(add to) the given unit info list. |
protected void |
parseJarFiles(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
Parse the jar-file XML elements. |
protected void |
parseMappingFiles(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
Parse the mapping-file XML elements. |
protected SpringPersistenceUnitInfo |
parsePersistenceUnitInfo(Element persistenceUnit)
Parse the unit info DOM element. |
protected void |
parseProperty(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
Parse the property XML elements. |
SpringPersistenceUnitInfo[] |
readPersistenceUnitInfos(String persistenceXmlLocation)
Parse and build all persistence unit infos defined in the specified XML file(s). |
SpringPersistenceUnitInfo[] |
readPersistenceUnitInfos(String[] persistenceXmlLocations)
Parse and build all persistence unit infos defined in the given XML files. |
protected Document |
validateResource(ErrorHandler handler,
InputStream stream)
Validate the given stream and return a valid DOM document for parsing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PersistenceUnitReader(ResourcePatternResolver resourcePatternResolver,
DataSourceLookup dataSourceLookup)
resourcePatternResolver - the ResourcePatternResolver to use for loading resourcesdataSourceLookup - the DataSourceLookup to resolve DataSource names in
persistence.xml files against| Method Detail |
|---|
public SpringPersistenceUnitInfo[] readPersistenceUnitInfos(String persistenceXmlLocation)
persistenceXmlLocation - the resource location (can be a pattern)
public SpringPersistenceUnitInfo[] readPersistenceUnitInfos(String[] persistenceXmlLocations)
persistenceXmlLocations - the resource locations (can be patterns)
protected Document validateResource(ErrorHandler handler,
InputStream stream)
throws ParserConfigurationException,
SAXException,
IOException
ParserConfigurationException
SAXException
IOExceptionprotected Resource findSchemaResource(String schemaName)
null if none found
protected List<SpringPersistenceUnitInfo> parseDocument(Resource resource,
Document document,
List<SpringPersistenceUnitInfo> infos)
throws IOException
IOException
protected URL determinePersistenceUnitRootUrl(Resource resource)
throws IOException
persistence.xml file we're reading).
resource - the resource to check
IOException - if the checking failed
protected SpringPersistenceUnitInfo parsePersistenceUnitInfo(Element persistenceUnit)
throws IOException
IOException
protected void parseProperty(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
property XML elements.
protected void parseClass(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
class XML elements.
protected void parseJarFiles(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
throws IOException
jar-file XML elements.
IOException
protected void parseMappingFiles(Element persistenceUnit,
SpringPersistenceUnitInfo unitInfo)
mapping-file XML elements.
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||