Class XMLPersistenceMappingSerializer
java.lang.Object
org.apache.openjpa.lib.meta.XMLMetaDataSerializer
org.apache.openjpa.lib.meta.CFMetaDataSerializer
org.apache.openjpa.persistence.XMLPersistenceMetaDataSerializer
org.apache.openjpa.persistence.jdbc.XMLPersistenceMappingSerializer
- All Implemented Interfaces:
MetaDataSerializer,AbstractCFMetaDataFactory.Serializer
Serializes persistence mapping to XML.
- Since:
- 0.4.0
- Author:
- Steve Kim
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classExtendsXMLPersistenceMetaDataSerializer.SerializationComparatorfor store-specific tags such as <sql-result-set-mapping>.Nested classes/interfaces inherited from class org.apache.openjpa.persistence.XMLPersistenceMetaDataSerializer
XMLPersistenceMetaDataSerializer.SerializationComparator -
Field Summary
Fields inherited from class org.apache.openjpa.persistence.XMLPersistenceMetaDataSerializer
TYPE_CLASS_QUERIES, TYPE_CLASS_SEQS, TYPE_META, TYPE_QUERY, TYPE_SEQFields inherited from interface org.apache.openjpa.lib.meta.MetaDataSerializer
APPEND, COMPACT, PRETTY, VERBOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(MetaDataRepository repos) Add all components in the given repository to the set to be serialized.protected voidaddCommments(Object obj) voidAdds the given result set mapping to local cache.protected voidaddSystemMappingElements(Collection toSerialize) Add system-level mapping elements to be serialized.voidclear()Clear the set of metadatas to be serialized.protected jakarta.persistence.EnumTypegetEnumType(FieldMapping field) Return enum type for the field.protected PersistenceStrategygetStrategy(FieldMetaData fmd) Return the serialized strategy name.booleanWhether to automatically synchronize mapping info with data available from mapped components before serialization.Create a new comparator for ordering objects that are to be serialized.booleanremoveAll(MetaDataRepository repos) Remove all the components in the given repository from the set to be serialized.booleanRemoves given result set mapping from the local cache.protected booleanserializeAttributeOverride(FieldMetaData fmd, FieldMetaData orig) Always returns false by default.protected voidSerialize attribute override mapping content.protected voidserializeClass(ClassMetaData meta, boolean access) Serialize class metadata.protected voidSerialize class mapping content.protected voidserializeFieldMappingContent(FieldMetaData fmd, PersistenceStrategy strategy) Serialize field mapping content; this will be called before#serializeValueMappingContent.protected voidserializeInheritanceContent(ClassMetaData mapping) Serialize inheritance content.protected voidSerialize order column.protected voidSerialize query mappings.protected voidSerialize sequence metadata.protected voidSerialize unknown mapping element at system level.voidsetSyncMappingInfo(boolean sync) Whether to automatically synchronize mapping info with data available from mapped components before serialization.protected intReturn the type constant for the given object based on its runtime class.Methods inherited from class org.apache.openjpa.persistence.XMLPersistenceMetaDataSerializer
addClassMappingAttributes, addFieldMappingAttributes, addMetaData, addQueryMetaData, addSequenceMetaData, addStrategyMappingAttributes, getClassMetaData, getConfiguration, getMode, getObjects, getPackage, getSerializeAnnotations, getSourceFile, isMappingMode, isMappingMode, isMappingMode, isMetaDataMode, isQueryMode, removeMetaData, removeQueryMetaData, removeSequenceMetaData, serialize, setMode, setMode, setSerializeAnnotationsMethods inherited from class org.apache.openjpa.lib.meta.CFMetaDataSerializer
getClassName, getPackage, groupByPackage, setPackageMethods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataSerializer
addAttribute, addComments, addComments, addText, currentBackupFile, endElement, getAttributes, getFileMap, getLog, isVerbose, prepareWrite, reset, serialize, serialize, serialize, serialize, serialize, serialize, setLog, startElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.lib.meta.MetaDataSerializer
serialize, serialize, serialize, serialize
-
Constructor Details
-
XMLPersistenceMappingSerializer
Constructor. Supply configuration.
-
-
Method Details
-
getSyncMappingInfo
public boolean getSyncMappingInfo()Whether to automatically synchronize mapping info with data available from mapped components before serialization. Defaults to false. -
setSyncMappingInfo
public void setSyncMappingInfo(boolean sync) Whether to automatically synchronize mapping info with data available from mapped components before serialization. Defaults to false. -
addQueryResultMapping
Adds the given result set mapping to local cache. -
removeQueryResultMapping
Removes given result set mapping from the local cache. -
addAll
Description copied from class:XMLPersistenceMetaDataSerializerAdd all components in the given repository to the set to be serialized.- Specified by:
addAllin interfaceAbstractCFMetaDataFactory.Serializer- Overrides:
addAllin classXMLPersistenceMetaDataSerializer
-
removeAll
Description copied from class:XMLPersistenceMetaDataSerializerRemove all the components in the given repository from the set to be serialized.- Overrides:
removeAllin classXMLPersistenceMetaDataSerializer- Returns:
- true if any components removed, false if none in set
-
clear
public void clear()Description copied from class:XMLPersistenceMetaDataSerializerClear the set of metadatas to be serialized.- Overrides:
clearin classXMLPersistenceMetaDataSerializer
-
addCommments
- Throws:
SAXException
-
serializeClass
Description copied from class:XMLPersistenceMetaDataSerializerSerialize class metadata.- Overrides:
serializeClassin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeClassMappingContent
Description copied from class:XMLPersistenceMetaDataSerializerSerialize class mapping content. Does nothing by default.- Overrides:
serializeClassMappingContentin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeInheritanceContent
Description copied from class:XMLPersistenceMetaDataSerializerSerialize inheritance content. Does nothing by default.- Overrides:
serializeInheritanceContentin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeAttributeOverride
Description copied from class:XMLPersistenceMetaDataSerializerAlways returns false by default.- Overrides:
serializeAttributeOverridein classXMLPersistenceMetaDataSerializer
-
serializeAttributeOverrideMappingContent
protected void serializeAttributeOverrideMappingContent(FieldMetaData fmd, FieldMetaData orig) throws SAXException Description copied from class:XMLPersistenceMetaDataSerializerSerialize attribute override mapping content. Does nothing by default,- Overrides:
serializeAttributeOverrideMappingContentin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
getStrategy
Description copied from class:XMLPersistenceMetaDataSerializerReturn the serialized strategy name.- Overrides:
getStrategyin classXMLPersistenceMetaDataSerializer
-
serializeFieldMappingContent
protected void serializeFieldMappingContent(FieldMetaData fmd, PersistenceStrategy strategy) throws SAXException Description copied from class:XMLPersistenceMetaDataSerializerSerialize field mapping content; this will be called before#serializeValueMappingContent. Does nothing by default.- Overrides:
serializeFieldMappingContentin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeOrderColumn
Serialize order column.- Overrides:
serializeOrderColumnin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
getEnumType
Return enum type for the field. -
newSerializationComparator
Description copied from class:XMLPersistenceMetaDataSerializerCreate a new comparator for ordering objects that are to be serialized.- Overrides:
newSerializationComparatorin classXMLPersistenceMetaDataSerializer
-
addSystemMappingElements
Description copied from class:XMLPersistenceMetaDataSerializerAdd system-level mapping elements to be serialized. Does nothing by default.- Overrides:
addSystemMappingElementsin classXMLPersistenceMetaDataSerializer
-
type
Description copied from class:XMLPersistenceMetaDataSerializerReturn the type constant for the given object based on its runtime class. If the runtime class does not correspond to any of the known types then returns -1. This can happen for tags that are not handled at this store-agnostic level.- Overrides:
typein classXMLPersistenceMetaDataSerializer
-
serializeSystemMappingElement
Description copied from class:XMLPersistenceMetaDataSerializerSerialize unknown mapping element at system level.- Overrides:
serializeSystemMappingElementin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeQueryMappings
Description copied from class:XMLPersistenceMetaDataSerializerSerialize query mappings. Does nothing by default.- Overrides:
serializeQueryMappingsin classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-
serializeSequence
Description copied from class:XMLPersistenceMetaDataSerializerSerialize sequence metadata.- Overrides:
serializeSequencein classXMLPersistenceMetaDataSerializer- Throws:
SAXException
-