Class PersistenceUnitMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.PersistenceUnitMetaData
- All Implemented Interfaces:
Serializable
MetaData representation of a "persistence.xml" persistence unit.
Corresponds to the JPA spec section 6.2.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionNames of the classes specified.(package private) StringDescription of the persistence unit.(package private) booleanWhether to exclude unlisted classes.Names/URLs of the JAR files specified.(package private) StringJTA data source for the persistence unit.Names of the mapping files specified.(package private) StringName of the persistence unit.(package private) StringNon-JTA data source for the persistence unit.(package private) PropertiesVendor properties.(package private) StringProvider for the persistence unit.(package private) URIRoot of the persistence unit.private static final long(package private) StringL2 cache mode for persistable objects.(package private) TransactionTypeTransaction type for this persistence unit.(package private) StringValidation Mode for Bean Validator.Fields inherited from class MetaData
EXTENSION_CLASS_CREATETIMESTAMP, EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_CREATEUSER, EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_CREATEUSER_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH, EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, EXTENSION_CLASS_MULTITENANT, EXTENSION_CLASS_READ_ONLY, EXTENSION_CLASS_SOFTDELETE, EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME, EXTENSION_CLASS_UPDATETIMESTAMP, EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_UPDATEUSER, EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME, EXTENSION_CLASS_VERSION_FIELD_NAME, EXTENSION_CLASS_VIEW_DEFINITION, EXTENSION_CLASS_VIEW_IMPORTS, EXTENSION_INDEX_COLUMN_ORDERING, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_ATTACH, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_CREATE_TIMESTAMP, EXTENSION_MEMBER_CREATE_USER, EXTENSION_MEMBER_ENUM_VALUE_GETTER, EXTENSION_MEMBER_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_INSERTABLE, EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_LIST_ORDERING, EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN, EXTENSION_MEMBER_RELATION_DISCRIM_PK, EXTENSION_MEMBER_RELATION_DISCRIM_VALUE, EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL, EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED, EXTENSION_MEMBER_TYPE_CONVERTER_NAME, EXTENSION_MEMBER_UPDATE_TIMESTAMP, EXTENSION_MEMBER_UPDATE_USER, EXTENSION_MEMBER_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, metaDataState, parent, VENDOR_NAME -
Constructor Summary
ConstructorsConstructorDescriptionPersistenceUnitMetaData(String name, String transactionType, URI rootURI) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassName(String className) voidaddClassNames(Set<String> classNames) voidaddJarFile(String jarName) voidaddJarFile(URL jarURL) Method to add a jar file to the persistence unit.voidaddJarFiles(Set<String> jarNames) voidaddMappingFile(String mappingFile) voidaddProperty(String key, String value) voidConvenience method to clear out all jar files.booleanAccessor for the jar files for this persistence unit.getName()Accessor for the persistence unit root.Accessor for the persistence unit shared cache mode.Accessor to the Validation ModevoidsetDescription(String desc) voidsetExcludeUnlistedClasses(boolean flag) voidsetJtaDataSource(String data) voidsetNonJtaDataSource(String data) voidsetProvider(String provider) voidsetSharedCacheMode(String cache) Mutator for the shared cache mode.voidsetTransactionType(String transType) voidsetValidationMode(String validationMode) Mutator for the validation modeReturns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.Methods inherited from class MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setInitialised, setParent, setPopulated, setUsed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
String nameName of the persistence unit. -
rootURI
URI rootURIRoot of the persistence unit. This can be used if wanting to scan for classes, to find the root to scan from. -
transactionType
TransactionType transactionTypeTransaction type for this persistence unit. -
description
String descriptionDescription of the persistence unit. -
provider
String providerProvider for the persistence unit. -
validationMode
String validationModeValidation Mode for Bean Validator. -
jtaDataSource
String jtaDataSourceJTA data source for the persistence unit. -
nonJtaDataSource
String nonJtaDataSourceNon-JTA data source for the persistence unit. -
classNames
-
jarFiles
-
mappingFileNames
-
properties
Properties propertiesVendor properties. -
excludeUnlistedClasses
boolean excludeUnlistedClassesWhether to exclude unlisted classes.
-
-
Constructor Details
-
PersistenceUnitMetaData
-
-
Method Details
-
getName
-
getRootURI
Accessor for the persistence unit root.- Returns:
- Root of the persistence unit
-
setTransactionType
-
getTransactionType
-
getDescription
-
setDescription
-
getProvider
-
setProvider
-
getJtaDataSource
-
setJtaDataSource
-
getNonJtaDataSource
-
setNonJtaDataSource
-
setValidationMode
Mutator for the validation mode- Parameters:
validationMode- AUTO, CALLBACK or NONE
-
getValidationMode
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean flag) -
getExcludeUnlistedClasses
public boolean getExcludeUnlistedClasses() -
addClassName
-
addClassNames
-
addJarFile
-
addJarFiles
-
addJarFile
Method to add a jar file to the persistence unit.- Parameters:
jarURL- Jar file URL
-
clearJarFiles
public void clearJarFiles()Convenience method to clear out all jar files. -
addMappingFile
-
addProperty
-
getClassNames
-
getMappingFiles
-
getJarFiles
Accessor for the jar files for this persistence unit. The contents of the Set may be Strings (the names) or URLs- Returns:
- The jar names
-
getProperties
-
toString
-