Package org.datanucleus.metadata
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) String
Description of the persistence unit.(package private) boolean
Whether to exclude unlisted classes.Names/URLs of the JAR files specified.(package private) String
JTA data source for the persistence unit.Names of the mapping files specified.(package private) String
Name of the persistence unit.(package private) String
Non-JTA data source for the persistence unit.(package private) Properties
Vendor properties.(package private) String
Provider for the persistence unit.(package private) URI
Root of the persistence unit.private static final long
(package private) String
L2 cache mode for persistable objects.(package private) TransactionType
Transaction type for this persistence unit.(package private) String
Validation Mode for Bean Validator.Fields inherited from class org.datanucleus.metadata.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 TypeMethodDescriptionvoid
addClassName
(String className) void
addClassNames
(Set<String> classNames) void
addJarFile
(String jarName) void
addJarFile
(URL jarURL) Method to add a jar file to the persistence unit.void
addJarFiles
(Set<String> jarNames) void
addMappingFile
(String mappingFile) void
addProperty
(String key, String value) void
Convenience method to clear out all jar files.boolean
Accessor 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 Modevoid
setDescription
(String desc) void
setExcludeUnlistedClasses
(boolean flag) void
setJtaDataSource
(String data) void
setNonJtaDataSource
(String data) void
setProvider
(String provider) void
setSharedCacheMode
(String cache) Mutator for the shared cache mode.void
setTransactionType
(String transType) void
setValidationMode
(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 org.datanucleus.metadata.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
Names of the classes specified. -
jarFiles
Names/URLs of the JAR files specified. -
mappingFileNames
Names of the mapping files specified. -
properties
Properties propertiesVendor properties. -
excludeUnlistedClasses
boolean excludeUnlistedClassesWhether to exclude unlisted classes.
-
-
Constructor Details
-
PersistenceUnitMetaData
Constructor.- Parameters:
name
- Name of the persistence unittransactionType
- Transaction type for this unitrootURI
- Root of the persistence-unit
-
-
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
Accessor to the Validation Mode- Returns:
- AUTO, CALLBACK or NONE
-
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
Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.- Parameters:
prefix
- prefix stringindent
- indent string- Returns:
- a string representation of the object.
-