Class JPAHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.orientechnologies.orient.object.jpa.parsing.JPAHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
This code is responsible for parsing the persistence.xml into PersistenceUnits
-
Constructor Summary
ConstructorsConstructorDescriptionJPAHandler(URL persistenceXmlRoot, JPAVersion jpaVersion) Create a new JPA Handler for the given persistence.xml -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Collect up the characters, as element's characters may be split across multiple calls.voidendElement(String uri, String localName, String name) voiderror(SAXParseException spe) We throw this exception to be caught further up and logged as an error therevoidstartElement(String uri, String localName, String name, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
JPAHandler
Create a new JPA Handler for the given persistence.xml- Parameters:
persistenceXmlRoot-jpaVersion- the version of the JPA schema used in the xml
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
characters
Collect up the characters, as element's characters may be split across multiple calls. Isn't SAX lovely...- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
error
We throw this exception to be caught further up and logged as an error there- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
getPersistenceUnits
- Returns:
- The collection of persistence units that we have parsed
-