Package org.apache.openjpa.persistence
Class XMLPersistenceMetaDataParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.openjpa.lib.meta.XMLMetaDataParser
-
- org.apache.openjpa.lib.meta.CFMetaDataParser
-
- org.apache.openjpa.persistence.XMLPersistenceMetaDataParser
-
- All Implemented Interfaces:
MetaDataParser,AbstractCFMetaDataFactory.Parser,org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler,org.xml.sax.ext.LexicalHandler
- Direct Known Subclasses:
XMLPersistenceMappingParser
public class XMLPersistenceMetaDataParser extends CFMetaDataParser implements AbstractCFMetaDataFactory.Parser
Custom SAX parser used by the system to quickly parse persistence metadata files. This parser may invoke another parser to scan source code annotation.- Author:
- Steve Kim, Pinaki Poddar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classXMLPersistenceMetaDataParser.localDBIdentifiers
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>_clsprotected static java.lang.StringELEM_ACCESSprotected static java.lang.StringELEM_ATTRSprotected static java.lang.StringELEM_CASCADEprotected static java.lang.StringELEM_CASCADE_ALLprotected static java.lang.StringELEM_CASCADE_DETprotected static java.lang.StringELEM_CASCADE_MERprotected static java.lang.StringELEM_CASCADE_PERprotected static java.lang.StringELEM_CASCADE_REFprotected static java.lang.StringELEM_CASCADE_REMprotected static java.lang.StringELEM_DELIM_IDSprotected static java.lang.StringELEM_LISTENERprotected static java.lang.StringELEM_PKGprotected static java.lang.StringELEM_PU_DEFprotected static java.lang.StringELEM_PU_METAprotected static java.lang.StringELEM_XML_MAP_META_COMPLETE-
Fields inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
_extendedNamespace, _openjpaNamespace
-
-
Constructor Summary
Constructors Constructor Description XMLPersistenceMetaDataParser(OpenJPAConfiguration conf)Constructor; supply configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDeferredEmbeddableMetaData()Process all deferred embeddables using an unknown access type.protected voidaddDeferredEmbeddableMetaData(java.lang.Class<?> embedType, int access)Process all deferred embeddables and embeddable mapping overrides for a given class.voidaddToParseList(java.lang.Class<?> parentCls)voidaddToParseList(java.util.ArrayList<java.lang.Class<?>> parseList)protected voidapplyDeferredEmbeddableOverrides(java.lang.Class<?> cls)protected java.lang.Class<?>classForName(java.lang.String name)Instantiate the given class, taking into account the default package.protected voidclearDeferredMetaData()protected java.lang.ObjectcurrentElement()Return the current element being parsed.protected java.lang.ObjectcurrentParent()Return the tag of the current parent element.protected PersistenceStrategycurrentStrategy()Return the currentPersistenceStrategyif any.protected voiddeferEmbeddable(java.lang.Class<?> embedType, MetaDataContext fmd)protected voidendClass(java.lang.String elem)End a class.protected voidendClassElement(java.lang.String name)Override this method marking the end of an element within a declared class.protected voidendClassMapping(ClassMetaData mapping)Implement to finalize class mapping.protected voidendClassMappingElement(java.lang.String name)Implement to parse a mapping element within a class.protected voidendEmbeddedId()protected voidendExtendedClass(java.lang.String elem)protected voidendFieldMapping(FieldMetaData field)Implement to finalize field mapping.protected voidendGeneratedValue()protected voidendId()protected voidendIdClass()protected voidendLob()protected voidendNamedNativeQuery()protected voidendNamedQuery()protected voidendQueryHint()protected voidendQueryString()protected voidendSequenceGenerator()protected voidendSystemElement(java.lang.String name)Override this method marking the end of an element outside of any package or class.protected voidendSystemMappingElement(java.lang.String name)Implement to parse a mapping element outside of any class.protected voidendVersion()AnnotationPersistenceMetaDataParsergetAnnotationParser()The annotation parser.protected java.lang.StringgetClassAttributeName()The attribute of the class element that holds the name, or null to use the element text.protected intgetClassElementDepth()The depth of the class element.OpenJPAConfigurationgetConfiguration()Configuration supplied on construction.java.lang.ClassLoadergetEnvClassLoader()Return the environmental class loader to pass on to parsed metadata instances.booleangetMappingOverride()Whether to allow later parses of mapping information to override earlier information for the same class.intgetMode()The parse mode according to the expected document type.protected java.lang.StringgetPackageAttributeName()The attribute of the package element that holds the name, or null to use the element text.java.lang.Class<?>getParseClass()java.util.ArrayList<java.lang.Class<?>>getParseList()MetaDataRepositorygetRepository()Returns the repository for this parser.protected java.lang.ObjectgetSchemaSource()Implement to return the XML schema source for the document.protected booleanisClassElementName(java.lang.String name)The name of the class element.protected booleanisDeferredEmbeddable(java.lang.Class<?> embedType, MetaDataContext fmd)protected booleanisDuplicateClass(ClassMetaData meta)Determines whether the ClassMetaData has been resolved more than once.protected booleanisDuplicateQuery(QueryMetaData meta)Determines whether the QueryMetaData has been resolved more than once.protected booleanisMappingMode()Convenience method for interpretinggetMode().protected booleanisMappingOverrideMode()Returns true if we're in mapping mode or in metadata mode with mapping override enabled.protected booleanisMetaDataMode()Convenience method for interpretinggetMode().protected booleanisQueryMode()Convenience method for interpretinggetMode().protected booleanisRuntime()Return whether we're running the parser at runtime.protected java.lang.StringnormalizeCatalogName(java.lang.String catName)protected java.lang.StringnormalizeSchemaName(java.lang.String schName)protected java.lang.StringnormalizeSequenceName(java.lang.String seqName)voidparse(java.io.File file)Parse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.voidparse(java.net.URL url)Parse the given resource.protected voidparseBasic(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse basic.protected voidparseEagerFetchModeAttr(FieldMetaData fmd, org.xml.sax.Attributes attrs)protected voidparseElementClassCriteriaAttr(FieldMetaData fmd, org.xml.sax.Attributes attrs)protected voidparseElementCollection(FieldMetaData fmd, org.xml.sax.Attributes attrs)protected voidparseEmbedded(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse embedded.booleanparseListContains(java.lang.Class<?> cls)protected voidparseManyToMany(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse many-to-many.protected voidparseManyToOne(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse many-to-one.protected voidparseOneToMany(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse one-to-many.protected voidparseOneToOne(FieldMetaData fmd, org.xml.sax.Attributes attrs)Parse one-to-one.protected voidparseStrategy(FieldMetaData fmd, org.xml.sax.Attributes attrs)protected java.lang.ObjectpeekElement()Peek a parse element from the stack.protected java.lang.ObjectpopElement()Pop a parse element from the stack.protected voidpushElement(java.lang.Object elem)Push a parse element onto the stack.protected voidreset()Override this method to clear any state and ready the parser for a new document.voidsetAnnotationParser(AnnotationPersistenceMetaDataParser parser)The annotation parser.protected voidsetCascades(FieldMetaData fmd)Set the cached cascades into the field.protected voidsetDeferredEmbeddableAccessType(java.lang.Class<?> embedType, int access)voidsetEnvClassLoader(java.lang.ClassLoader loader)Set the environmental class loader to pass on to parsed metadata instances.voidsetMappingOverride(boolean override)Whether to allow later parses of mapping information to override earlier information for the same class.voidsetMode(int mode)The parse mode according to the expected document type.voidsetMode(int mode, boolean on)The parse mode according to the expected document type.protected voidsetOrphanRemoval(ValueMetaData vmd, boolean orphanRemoval)voidsetRepository(MetaDataRepository repos)Set the metadata repository for this parser.protected booleanstartCascade(java.lang.Object tag, org.xml.sax.Attributes attrs)Lazily parse cascades.protected booleanstartClass(java.lang.String elem, org.xml.sax.Attributes attrs)Start a class.protected booleanstartClassElement(java.lang.String name, org.xml.sax.Attributes attrs)Override this method marking the start of an element within a declared class.protected voidstartClassMapping(ClassMetaData mapping, boolean mappedSuper, org.xml.sax.Attributes attrs)Implement to add mapping attributes to class.protected java.lang.ObjectstartClassMappingElement(java.lang.String name, org.xml.sax.Attributes attrs)Implement to parse a mapping element within a class.protected booleanstartDelimitedIdentifiers()protected booleanstartEmbeddedId(org.xml.sax.Attributes attrs)Parse embedded-id.protected voidstartFieldMapping(FieldMetaData field, org.xml.sax.Attributes attrs)Implement to add field mapping data.protected booleanstartGeneratedValue(org.xml.sax.Attributes attrs)Parse generated-value.protected booleanstartId(org.xml.sax.Attributes attrs)Parse id.protected booleanstartIdClass(org.xml.sax.Attributes attrs)Parse id-class.protected booleanstartLob(org.xml.sax.Attributes attrs)Parse lob.protected booleanstartNamedNativeQuery(org.xml.sax.Attributes attrs)Parse native-named-query.protected booleanstartNamedQuery(org.xml.sax.Attributes attrs)Parse named-query.protected booleanstartOrderColumn(org.xml.sax.Attributes attrs)protected booleanstartQueryHint(org.xml.sax.Attributes attrs)Parse query-hint.protected booleanstartQueryString(org.xml.sax.Attributes attrs)protected booleanstartSequenceGenerator(org.xml.sax.Attributes attrs)Parse sequence-generator.protected booleanstartSystemElement(java.lang.String name, org.xml.sax.Attributes attrs)Override this method marking the start of an element outside of any package or class.protected java.lang.ObjectstartSystemMappingElement(java.lang.String name, org.xml.sax.Attributes attrs)Implement to parse a mapping element outside of any class.protected booleanstartVersion(org.xml.sax.Attributes attrs)Parse version.-
Methods inherited from class org.apache.openjpa.lib.meta.CFMetaDataParser
classForName, classForName, currentClassName, currentPackage, endElement, endPackage, endPackageElement, getPackageElementDepth, isPackageElementName, startElement, startExtendedClass, startPackage, startPackageElement
-
Methods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
addComments, addResult, characters, clear, comment, currentClassLoader, currentComments, currentDepth, currentLocation, currentText, endCDATA, endDTD, endElement, endEntity, error, fatalError, finish, getClassLoader, getDocType, getException, getException, getException, getLexicalHandler, getLocation, getLog, getOverrideContextClassloader, getParseComments, getParseText, getResults, getSourceFile, getSourceIsSystemId, getSourceName, getSuffix, ignoreContent, isCaching, isParsing, isValidating, parse, parse, parse, parse, parsed, parseNewResource, setCaching, setClassLoader, setDocumentLocator, setLexicalHandler, setLocation, setLog, setOverrideContextClassloader, setParseComments, setParseText, setParsing, setSourceIsSystemId, setSuffix, setValidating, startCDATA, startDTD, startElement, startEntity
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.lib.meta.MetaDataParser
clear, getResults, parse, parse, parse, parse, setClassLoader
-
-
-
-
Field Detail
-
ELEM_PKG
protected static final java.lang.String ELEM_PKG
- See Also:
- Constant Field Values
-
ELEM_ACCESS
protected static final java.lang.String ELEM_ACCESS
- See Also:
- Constant Field Values
-
ELEM_ATTRS
protected static final java.lang.String ELEM_ATTRS
- See Also:
- Constant Field Values
-
ELEM_LISTENER
protected static final java.lang.String ELEM_LISTENER
- See Also:
- Constant Field Values
-
ELEM_CASCADE
protected static final java.lang.String ELEM_CASCADE
- See Also:
- Constant Field Values
-
ELEM_CASCADE_ALL
protected static final java.lang.String ELEM_CASCADE_ALL
- See Also:
- Constant Field Values
-
ELEM_CASCADE_PER
protected static final java.lang.String ELEM_CASCADE_PER
- See Also:
- Constant Field Values
-
ELEM_CASCADE_MER
protected static final java.lang.String ELEM_CASCADE_MER
- See Also:
- Constant Field Values
-
ELEM_CASCADE_REM
protected static final java.lang.String ELEM_CASCADE_REM
- See Also:
- Constant Field Values
-
ELEM_CASCADE_REF
protected static final java.lang.String ELEM_CASCADE_REF
- See Also:
- Constant Field Values
-
ELEM_CASCADE_DET
protected static final java.lang.String ELEM_CASCADE_DET
- See Also:
- Constant Field Values
-
ELEM_PU_META
protected static final java.lang.String ELEM_PU_META
- See Also:
- Constant Field Values
-
ELEM_PU_DEF
protected static final java.lang.String ELEM_PU_DEF
- See Also:
- Constant Field Values
-
ELEM_XML_MAP_META_COMPLETE
protected static final java.lang.String ELEM_XML_MAP_META_COMPLETE
- See Also:
- Constant Field Values
-
ELEM_DELIM_IDS
protected static final java.lang.String ELEM_DELIM_IDS
- See Also:
- Constant Field Values
-
_cls
protected java.lang.Class<?> _cls
-
-
Constructor Detail
-
XMLPersistenceMetaDataParser
public XMLPersistenceMetaDataParser(OpenJPAConfiguration conf)
Constructor; supply configuration.
-
-
Method Detail
-
getConfiguration
public OpenJPAConfiguration getConfiguration()
Configuration supplied on construction.
-
getAnnotationParser
public AnnotationPersistenceMetaDataParser getAnnotationParser()
The annotation parser. When class is discovered in an XML file, we first parse any annotations present, then override with the XML.
-
setAnnotationParser
public void setAnnotationParser(AnnotationPersistenceMetaDataParser parser)
The annotation parser. When class is discovered in an XML file, we first parse any annotations present, then override with the XML.
-
getRepository
public MetaDataRepository getRepository()
Returns the repository for this parser. If none has been set, creates a new repository and sets it.- Specified by:
getRepositoryin interfaceAbstractCFMetaDataFactory.Parser
-
setRepository
public void setRepository(MetaDataRepository repos)
Set the metadata repository for this parser.
-
getEnvClassLoader
public java.lang.ClassLoader getEnvClassLoader()
Return the environmental class loader to pass on to parsed metadata instances.
-
setEnvClassLoader
public void setEnvClassLoader(java.lang.ClassLoader loader)
Set the environmental class loader to pass on to parsed metadata instances.
-
getMappingOverride
public boolean getMappingOverride()
Whether to allow later parses of mapping information to override earlier information for the same class. Defaults to false. Useful when a tool is mapping a class, so that .jdo file partial mapping information can be used even when mappings are stored in .orm files or other locations.
-
setMappingOverride
public void setMappingOverride(boolean override)
Whether to allow later parses of mapping information to override earlier information for the same class. Defaults to false. Useful when a tool is mapping a class, so that .jdo file partial mapping information can be used even when mappings are stored in .orm files or other locations.
-
getMode
public int getMode()
The parse mode according to the expected document type. The mode constants act as bit flags, and therefore can be combined.
-
setMode
public void setMode(int mode, boolean on)The parse mode according to the expected document type.
-
setMode
public void setMode(int mode)
The parse mode according to the expected document type.- Specified by:
setModein interfaceAbstractCFMetaDataFactory.Parser
-
parse
public void parse(java.net.URL url) throws java.io.IOExceptionDescription copied from interface:MetaDataParserParse the given resource.- Specified by:
parsein interfaceMetaDataParser- Overrides:
parsein classXMLMetaDataParser- Throws:
java.io.IOException
-
parse
public void parse(java.io.File file) throws java.io.IOExceptionDescription copied from interface:MetaDataParserParse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.- Specified by:
parsein interfaceMetaDataParser- Overrides:
parsein classXMLMetaDataParser- Throws:
java.io.IOException
-
isMetaDataMode
protected boolean isMetaDataMode()
Convenience method for interpretinggetMode().
-
isQueryMode
protected boolean isQueryMode()
Convenience method for interpretinggetMode().
-
isMappingMode
protected boolean isMappingMode()
Convenience method for interpretinggetMode().
-
isMappingOverrideMode
protected boolean isMappingOverrideMode()
Returns true if we're in mapping mode or in metadata mode with mapping override enabled.
-
pushElement
protected void pushElement(java.lang.Object elem)
Push a parse element onto the stack.
-
popElement
protected java.lang.Object popElement()
Pop a parse element from the stack.
-
peekElement
protected java.lang.Object peekElement()
Peek a parse element from the stack.
-
currentElement
protected java.lang.Object currentElement()
Return the current element being parsed. May be a class metadata, field metadata, query metadata, etc.
-
currentStrategy
protected PersistenceStrategy currentStrategy()
Return the currentPersistenceStrategyif any.
-
currentParent
protected java.lang.Object currentParent()
Return the tag of the current parent element.
-
isRuntime
protected boolean isRuntime()
Return whether we're running the parser at runtime.
-
getSchemaSource
protected java.lang.Object getSchemaSource()
Description copied from class:XMLMetaDataParserImplement to return the XML schema source for the document. Returns null by default. May return:Stringpointing to schema URI.InputStreamcontaining schema contents.InputSourcecontaining schema contents.Filecontaining schema contents.- Array of any of the above elements.
- Overrides:
getSchemaSourcein classXMLMetaDataParser
-
getPackageAttributeName
protected java.lang.String getPackageAttributeName()
Description copied from class:CFMetaDataParserThe attribute of the package element that holds the name, or null to use the element text. Defaults to "name".- Overrides:
getPackageAttributeNamein classCFMetaDataParser
-
getClassAttributeName
protected java.lang.String getClassAttributeName()
Description copied from class:CFMetaDataParserThe attribute of the class element that holds the name, or null to use the element text. Defaults to "name".- Overrides:
getClassAttributeNamein classCFMetaDataParser
-
getClassElementDepth
protected int getClassElementDepth()
Description copied from class:CFMetaDataParserThe depth of the class element. Defaults to 2.- Overrides:
getClassElementDepthin classCFMetaDataParser
-
isClassElementName
protected boolean isClassElementName(java.lang.String name)
Description copied from class:CFMetaDataParserThe name of the class element. Defaults to "class".- Overrides:
isClassElementNamein classCFMetaDataParser
-
reset
protected void reset()
Description copied from class:CFMetaDataParserOverride this method to clear any state and ready the parser for a new document. Subclasses should callsuper.reset()to clear superclass state.- Overrides:
resetin classCFMetaDataParser
-
startSystemElement
protected boolean startSystemElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserOverride this method marking the start of an element outside of any package or class.- Overrides:
startSystemElementin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
endSystemElement
protected void endSystemElement(java.lang.String name) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserOverride this method marking the end of an element outside of any package or class.- Overrides:
endSystemElementin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
startSystemMappingElement
protected java.lang.Object startSystemMappingElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionImplement to parse a mapping element outside of any class.- Returns:
- the tag for the given element, or null to skip the element
- Throws:
org.xml.sax.SAXException
-
endSystemMappingElement
protected void endSystemMappingElement(java.lang.String name) throws org.xml.sax.SAXExceptionImplement to parse a mapping element outside of any class.- Throws:
org.xml.sax.SAXException
-
startClassElement
protected boolean startClassElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserOverride this method marking the start of an element within a declared class.- Overrides:
startClassElementin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
endClassElement
protected void endClassElement(java.lang.String name) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserOverride this method marking the end of an element within a declared class.- Overrides:
endClassElementin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
startClassMappingElement
protected java.lang.Object startClassMappingElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionImplement to parse a mapping element within a class.- Returns:
- the tag for the given element, or null to skip element
- Throws:
org.xml.sax.SAXException
-
endClassMappingElement
protected void endClassMappingElement(java.lang.String name) throws org.xml.sax.SAXExceptionImplement to parse a mapping element within a class.- Throws:
org.xml.sax.SAXException
-
startClass
protected boolean startClass(java.lang.String elem, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserStart a class. Parses out class name by default. Return false to skip class element and its contents.- Overrides:
startClassin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
endClass
protected void endClass(java.lang.String elem) throws org.xml.sax.SAXExceptionDescription copied from class:CFMetaDataParserEnd a class. Parses contained text by default.- Overrides:
endClassin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
startClassMapping
protected void startClassMapping(ClassMetaData mapping, boolean mappedSuper, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Implement to add mapping attributes to class.- Throws:
org.xml.sax.SAXException
-
endClassMapping
protected void endClassMapping(ClassMetaData mapping) throws org.xml.sax.SAXException
Implement to finalize class mapping.- Throws:
org.xml.sax.SAXException
-
startSequenceGenerator
protected boolean startSequenceGenerator(org.xml.sax.Attributes attrs)
Parse sequence-generator.
-
endSequenceGenerator
protected void endSequenceGenerator()
-
startId
protected boolean startId(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse id.- Throws:
org.xml.sax.SAXException
-
endId
protected void endId() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startEmbeddedId
protected boolean startEmbeddedId(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse embedded-id.- Throws:
org.xml.sax.SAXException
-
endEmbeddedId
protected void endEmbeddedId() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startIdClass
protected boolean startIdClass(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse id-class.- Throws:
org.xml.sax.SAXException
-
endIdClass
protected void endIdClass() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startLob
protected boolean startLob(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse lob.- Throws:
org.xml.sax.SAXException
-
endLob
protected void endLob() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startGeneratedValue
protected boolean startGeneratedValue(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse generated-value.- Throws:
org.xml.sax.SAXException
-
endGeneratedValue
protected void endGeneratedValue() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startCascade
protected boolean startCascade(java.lang.Object tag, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionLazily parse cascades.- Throws:
org.xml.sax.SAXException
-
setCascades
protected void setCascades(FieldMetaData fmd)
Set the cached cascades into the field.
-
startFieldMapping
protected void startFieldMapping(FieldMetaData field, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Implement to add field mapping data. Does nothing by default.- Throws:
org.xml.sax.SAXException
-
endFieldMapping
protected void endFieldMapping(FieldMetaData field) throws org.xml.sax.SAXException
Implement to finalize field mapping. Does nothing by default.- Throws:
org.xml.sax.SAXException
-
startVersion
protected boolean startVersion(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse version.- Throws:
org.xml.sax.SAXException
-
endVersion
protected void endVersion() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
parseBasic
protected void parseBasic(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse basic.- Throws:
org.xml.sax.SAXException
-
parseEmbedded
protected void parseEmbedded(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse embedded.- Throws:
org.xml.sax.SAXException
-
parseOneToOne
protected void parseOneToOne(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse one-to-one.- Throws:
org.xml.sax.SAXException
-
parseManyToOne
protected void parseManyToOne(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse many-to-one.- Throws:
org.xml.sax.SAXException
-
parseManyToMany
protected void parseManyToMany(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse many-to-many.- Throws:
org.xml.sax.SAXException
-
parseOneToMany
protected void parseOneToMany(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Parse one-to-many.- Throws:
org.xml.sax.SAXException
-
setOrphanRemoval
protected void setOrphanRemoval(ValueMetaData vmd, boolean orphanRemoval)
-
parseElementCollection
protected void parseElementCollection(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
startNamedQuery
protected boolean startNamedQuery(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse named-query.- Throws:
org.xml.sax.SAXException
-
endNamedQuery
protected void endNamedQuery() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startQueryString
protected boolean startQueryString(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
endQueryString
protected void endQueryString() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startQueryHint
protected boolean startQueryHint(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse query-hint.- Throws:
org.xml.sax.SAXException
-
endQueryHint
protected void endQueryHint() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startNamedNativeQuery
protected boolean startNamedNativeQuery(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionParse native-named-query.- Throws:
org.xml.sax.SAXException
-
endNamedNativeQuery
protected void endNamedNativeQuery() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
startOrderColumn
protected boolean startOrderColumn(org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
classForName
protected java.lang.Class<?> classForName(java.lang.String name) throws org.xml.sax.SAXExceptionInstantiate the given class, taking into account the default package.- Throws:
org.xml.sax.SAXException
-
addDeferredEmbeddableMetaData
protected void addDeferredEmbeddableMetaData()
Process all deferred embeddables using an unknown access type.
-
addDeferredEmbeddableMetaData
protected void addDeferredEmbeddableMetaData(java.lang.Class<?> embedType, int access) throws org.xml.sax.SAXExceptionProcess all deferred embeddables and embeddable mapping overrides for a given class. This should only happen after the access type of the embeddable is known.- Parameters:
embedType- embeddable classaccess- class level access for embeddable- Throws:
org.xml.sax.SAXException
-
setDeferredEmbeddableAccessType
protected void setDeferredEmbeddableAccessType(java.lang.Class<?> embedType, int access)
-
clearDeferredMetaData
protected void clearDeferredMetaData()
- Overrides:
clearDeferredMetaDatain classXMLMetaDataParser
-
isDeferredEmbeddable
protected boolean isDeferredEmbeddable(java.lang.Class<?> embedType, MetaDataContext fmd)
-
deferEmbeddable
protected void deferEmbeddable(java.lang.Class<?> embedType, MetaDataContext fmd)
-
applyDeferredEmbeddableOverrides
protected void applyDeferredEmbeddableOverrides(java.lang.Class<?> cls) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
addToParseList
public void addToParseList(java.util.ArrayList<java.lang.Class<?>> parseList)
-
addToParseList
public void addToParseList(java.lang.Class<?> parentCls)
-
parseListContains
public boolean parseListContains(java.lang.Class<?> cls)
-
getParseList
public java.util.ArrayList<java.lang.Class<?>> getParseList()
-
getParseClass
public java.lang.Class<?> getParseClass()
-
startDelimitedIdentifiers
protected boolean startDelimitedIdentifiers()
-
normalizeSequenceName
protected java.lang.String normalizeSequenceName(java.lang.String seqName)
-
normalizeSchemaName
protected java.lang.String normalizeSchemaName(java.lang.String schName)
-
normalizeCatalogName
protected java.lang.String normalizeCatalogName(java.lang.String catName)
-
isDuplicateClass
protected boolean isDuplicateClass(ClassMetaData meta)
Determines whether the ClassMetaData has been resolved more than once. Compares the current sourceName and linenumber to the ones used to originally resolve the metadata.- Parameters:
meta- The ClassMetaData to inspect.- Returns:
- true if the source was has already been resolved from a different location. Otherwise return false
-
isDuplicateQuery
protected boolean isDuplicateQuery(QueryMetaData meta)
Determines whether the QueryMetaData has been resolved more than once.- Parameters:
meta- QueryMetaData that has already been resolved.- Returns:
- true if the QueryMetaData was defined in a different place - e.g. another line in orm.xml.
-
parseStrategy
protected void parseStrategy(FieldMetaData fmd, org.xml.sax.Attributes attrs)
-
parseElementClassCriteriaAttr
protected void parseElementClassCriteriaAttr(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
parseEagerFetchModeAttr
protected void parseEagerFetchModeAttr(FieldMetaData fmd, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
endExtendedClass
protected void endExtendedClass(java.lang.String elem) throws org.xml.sax.SAXException- Overrides:
endExtendedClassin classCFMetaDataParser- Throws:
org.xml.sax.SAXException
-
-