org.eclipse.jpt.core.context.persistence
Interface PersistenceUnit

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model, XmlContextNode
All Known Subinterfaces:
PersistenceUnit2_0

public interface PersistenceUnit
extends XmlContextNode, JpaStructureNode

Context model corresponding to the XML resource model XmlPersistenceUnit, which corresponds to the persistence-unit element in the persistence.xml file.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
2.0
Version:
2.3

Nested Class Summary
static interface PersistenceUnit.Property
          Simple property interface.
 
Field Summary
static java.lang.String DEFAULT_ACCESS_PROPERTY
          String constant associated with changes to the persistence unit's default access type.
static java.lang.String DEFAULT_CASCADE_PERSIST_PROPERTY
          String constant associated with changes to the persistence unit's default "cascade persist" flag.
static java.lang.String DEFAULT_CATALOG_PROPERTY
          String constant associated with changes to the persistence unit's default database catalog.
static java.lang.String DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY
          String constant associated with changes to the persistence unit's default "exclude unlisted classes" flag (not typically changed).
static java.lang.String DEFAULT_SCHEMA_PROPERTY
          String constant associated with changes to the persistence unit's default database schema.
static java.lang.String DEFAULT_TRANSACTION_TYPE_PROPERTY
          String constant associated with changes to the persistence unit's default transaction type (not typically changed).
static java.lang.String DESCRIPTION_PROPERTY
          String constant associated with changes to the persistence unit's description.
static java.lang.String GENERATORS_LIST
          String constant associated with changes to the persistence unit's list of "global" generators.
static java.lang.String IMPLIED_CLASS_REFS_COLLECTION
          String constant associated with changes to the persistence unit's implied class refs.
static java.lang.String IMPLIED_MAPPING_FILE_REF_PROPERTY
          String constant associated with changes to the persistence unit's implied mapping file ref.
static java.lang.String JAR_FILE_REFS_LIST
          String constant associated with changes to the persistence unit's JAR file refs.
static java.lang.String JTA_DATA_SOURCE_PROPERTY
          String constant associated with changes to the persistence unit's JTA data source
static java.lang.String NAME_PROPERTY
          String constant associated with changes to the persistence unit's name.
static java.lang.String NON_JTA_DATA_SOURCE_PROPERTY
          String constant associated with changes to the persistence unit's non-JTA data source
static java.lang.String PROPERTIES_LIST
          String constant associated with changes to the persistence unit's properties.
static java.lang.String PROVIDER_PROPERTY
          String constant associated with changes to the persistence unit's provider.
static java.lang.String QUERIES_LIST
          String constant associated with changes to the persistence unit's list of "global" queries.
static java.lang.String SPECIFIED_CLASS_REFS_LIST
          String constant associated with changes to the persistence unit's specified class refs.
static java.lang.String SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY
          String constant associated with changes to the persistence unit's "exclude unlisted classes" flag.
static java.lang.String SPECIFIED_MAPPING_FILE_REFS_LIST
          String constant associated with changes to the persistence unit's specified mapping file refs.
static java.lang.String SPECIFIED_TRANSACTION_TYPE_PROPERTY
          String constant associated with changes to the persistence unit's specified transaction type
 
Method Summary
 void addGenerator(Generator generator)
          Add the specified generator (that is defined elsewhere) to the list of generators defined within the persistence unit's scope.
 JarFileRef addJarFileRef()
          Add a new JAR file ref to the persistence unit; return the newly-created JAR file ref.
 JarFileRef addJarFileRef(int index)
          Add a new JAR file ref to the persistence unit at the specified index; return the newly-created JAR file ref.
 PersistenceUnit.Property addProperty()
          Add a new property to the persistence unit; return the newly-created property.
 PersistenceUnit.Property addProperty(int index)
          Add a new property to the persistence unit at the specified index; return the newly-created property.
 void addQuery(Query query)
          Add the specified query (that is defined elsewhere) to the list of queries defined within the persistence unit's scope.
 void addRootEntityWithSubEntities(java.lang.String entityName)
          The entity with the given name is a root entity that has sub entities.
 ClassRef addSpecifiedClassRef()
          Add a new specified class ref to the persistence unit; return the newly-created class ref.
 ClassRef addSpecifiedClassRef(int index)
          Add a new specified class ref to the persistence unit at the specified index; return the newly-created class ref.
 MappingFileRef addSpecifiedMappingFileRef()
          Add a new specified mapping file ref to the persistence unit; return the newly-created mapping file ref.
 MappingFileRef addSpecifiedMappingFileRef(int index)
          Add a new specified mapping file ref to the persistence unit at the specified index; return the newly-created mapping file ref.
 java.util.Iterator<ClassRef> classRefs()
          Return the persistence unit's list of class refs, both specified and implied.
 int classRefsSize()
          Return the size of the persistence unit's list of class refs, both specified and implied.
 boolean containsOffset(int textOffset)
          Return whether the text representation of this persistence unit contains the given text offset
 boolean entityIsRootWithSubEntities(java.lang.String entityName)
          Return whether the entity with the given name is a root entity that also has sub entities.
 boolean excludesUnlistedClasses()
          Return whether the persistence unit excludes unlisted classes.
 java.util.ListIterator<Generator> generators()
          Return the list of generators defined within the persistence unit's scope, including generators with duplicate names.
 int generatorsSize()
          Return the size of the list of generators defined within the persistence unit's scope, including generators with duplicate names.
 AccessType getDefaultAccess()
          Return the default access type from the first persistence unit defaults found in the persistence unit's list of mapping files.
 boolean getDefaultCascadePersist()
          Return the default "cascade persist" flag from the first persistence unit defaults found in the persistence unit's list of mapping files.
 java.lang.String getDefaultCatalog()
          Return the default database catalog from the first persistence unit defaults found in the persistence unit's list of mapping files.
 boolean getDefaultExcludeUnlistedClasses()
          Return whether the persistence unit excludes unlisted classes by default.
 java.lang.String getDefaultSchema()
          Return the default database schema from the first persistence unit defaults found in the persistence unit's list of mapping files.
 PersistenceUnitTransactionType getDefaultTransactionType()
          Return the persistence unit's default transaction type.
 java.lang.String getDescription()
          Return the persistence unit's description.
 Embeddable getEmbeddable(java.lang.String typeName)
          Return the embeddable specified in the persistence unit with the specified name.
 Entity getEntity(java.lang.String typeName)
          Return the entity specified in the persistence unit with the specified name.
 MappingFileRef getImpliedMappingFileRef()
          Return the persistence unit's implied mapping file ref.
 java.lang.String getJtaDataSource()
          Return the persistence unit's JTA data source.
 java.lang.String getName()
          Return the persistence unit's name.
 java.lang.String getNonJtaDataSource()
          Return the persistence unit's non-JTA data source.
 Persistence getParent()
          Covariant override.
 PersistentType getPersistentType(java.lang.String typeName)
          Return the persistent type specified in the persistence unit with the specified name.
 PersistenceUnit.Property getProperty(java.lang.String propertyName)
          Return the *first* property in the persistence unit's property list with the specified name.
 java.lang.String getProvider()
          Return the persistence unit's provider.
 java.lang.Boolean getSpecifiedExcludeUnlistedClasses()
          Return the persistence unit's specified "exclude unlisted classes" flag.
 PersistenceUnitTransactionType getSpecifiedTransactionType()
          Return the persistence unit's specified transaction type.
 PersistenceUnitTransactionType getTransactionType()
          Return the persistence unit's transaction type, whether specified or defaulted.
 java.util.Iterator<ClassRef> impliedClassRefs()
          Return the persistence unit's list of implied class refs.
 int impliedClassRefsSize()
          Return the size of the persistence unit's list of implied class refs.
 java.util.ListIterator<JarFileRef> jarFileRefs()
          Return the persistence unit's list of JAR file refs.
 int jarFileRefsSize()
          Return the size of the persistence unit's list of JAR file refs.
 java.util.ListIterator<MappingFileRef> mappingFileRefs()
          Return the persistence unit's list of mapping file refs, both specified and implied.
 java.util.Iterator<MappingFileRef> mappingFileRefsContaining(java.lang.String typeName)
          Return all the mapping file refs, both specified and implied, containing the specified type.
 int mappingFileRefsSize()
          Return the size of the persistence unit's list of mapping file refs, both specified and implied.
 java.util.ListIterator<PersistenceUnit.Property> properties()
          Return the persistence unit's list of properties.
 int propertiesSize()
          Return the size of the persistence unit's list of properties.
 java.util.Iterator<PersistenceUnit.Property> propertiesWithNamePrefix(java.lang.String propertyNamePrefix)
          Return the persistence unit's properties with names beginning with the specified prefix.
 void propertyNameChanged(java.lang.String oldPropertyName, java.lang.String newPropertyName, java.lang.String value)
          Call back method for Property name changing.
 void propertyValueChanged(java.lang.String propertyName, java.lang.String newValue)
          Call back method for Property value changing.
 java.util.ListIterator<Query> queries()
          Return the list of queries defined within the persistence unit's scope, including queries with duplicate names.
 int queriesSize()
          Return the size of the list of queries defined within the persistence unit's scope, including queries with duplicate names.
 void removeJarFileRef(int index)
          Remove the JAR file ref at the specified index from the persistence unit.
 void removeJarFileRef(JarFileRef jarFileRef)
          Remove the specified JAR file ref from the persistence unit.
 void removeProperty(PersistenceUnit.Property property)
          Remove the specified property from the persistence unit.
 void removeProperty(java.lang.String propertyName)
          Remove the *first* property in the persistence unit's property list with the specified name.
 void removeProperty(java.lang.String propertyName, java.lang.String value)
          Remove the *first* property in the persistence unit's property list with the specified name and value, allowing the removal of properties with duplicate property names.
 void removeSpecifiedClassRef(ClassRef classRef)
          Remove the specified class ref from the persistence unit.
 void removeSpecifiedClassRef(int index)
          Remove the specified class ref at the specified index from the persistence unit.
 void removeSpecifiedMappingFileRef(int index)
          Remove the specified mapping file ref at the specified index from the persistence unit.
 void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef)
          Remove the specified mapping file ref from the persistence unit.
 void setDescription(java.lang.String description)
          Set the persistence unit's description.
 void setJtaDataSource(java.lang.String jtaDataSource)
          Set the persistence unit's JTA data source.
 void setName(java.lang.String name)
          Set the persistence unit's name.
 void setNonJtaDataSource(java.lang.String nonJtaDataSource)
          Set the persistence unit's non-JTA data source.
 void setProperty(java.lang.String propertyName, java.lang.String value)
          Set the value of the *first* property in the persistence unit's property list with the specified name to the specified value, creating a new property if one does not already exist.
 void setProperty(java.lang.String propertyName, java.lang.String value, boolean duplicatePropertyNamesAllowed)
          Set the value of the property with the specified name, creating a new property if one does not exist or if the specified flag indicates duplicate property names are allowed.
 void setProvider(java.lang.String provider)
          Set the persistence unit's provider.
 void setSpecifiedExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
          Set the persistence unit's specified "exclude unlisted classes" flag.
 void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType)
          Set the persistence unit's specified transaction type.
 boolean shouldValidateAgainstDatabase()
          Return whether any database metadata specific validation should occur.
 java.util.ListIterator<ClassRef> specifiedClassRefs()
          Return the persistence unit's list of specified class refs.
 int specifiedClassRefsSize()
          Return the size of the persistence unit's list of specified mapping file refs.
 java.util.ListIterator<MappingFileRef> specifiedMappingFileRefs()
          Return the persistence unit's list of specified mapping file refs.
 int specifiedMappingFileRefsSize()
          Return the size of the persistence unit's list of specified mapping file refs.
 boolean specifiesPersistentType(java.lang.String typeName)
          Return whether the persistence unit specifies a persistent type with the specified name (i.e.
 java.lang.String[] uniqueGeneratorNames()
          Return the names of the generators defined in the persistence unit's scope, with duplicates removed.
 void update(XmlPersistenceUnit persistenceUnit)
          Update the PersistenceUnit context model object to match the XmlPersistenceUnit resource model object.
 
Methods inherited from interface org.eclipse.jpt.core.context.XmlContextNode
getValidationTextRange, validate
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, postUpdate
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 

Field Detail

NAME_PROPERTY

static final java.lang.String NAME_PROPERTY
String constant associated with changes to the persistence unit's name.

See Also:
Constant Field Values

SPECIFIED_TRANSACTION_TYPE_PROPERTY

static final java.lang.String SPECIFIED_TRANSACTION_TYPE_PROPERTY
String constant associated with changes to the persistence unit's specified transaction type

See Also:
Constant Field Values

DEFAULT_TRANSACTION_TYPE_PROPERTY

static final java.lang.String DEFAULT_TRANSACTION_TYPE_PROPERTY
String constant associated with changes to the persistence unit's default transaction type (not typically changed).

See Also:
Constant Field Values

DESCRIPTION_PROPERTY

static final java.lang.String DESCRIPTION_PROPERTY
String constant associated with changes to the persistence unit's description.

See Also:
Constant Field Values

PROVIDER_PROPERTY

static final java.lang.String PROVIDER_PROPERTY
String constant associated with changes to the persistence unit's provider.

See Also:
Constant Field Values

JTA_DATA_SOURCE_PROPERTY

static final java.lang.String JTA_DATA_SOURCE_PROPERTY
String constant associated with changes to the persistence unit's JTA data source

See Also:
Constant Field Values

NON_JTA_DATA_SOURCE_PROPERTY

static final java.lang.String NON_JTA_DATA_SOURCE_PROPERTY
String constant associated with changes to the persistence unit's non-JTA data source

See Also:
Constant Field Values

SPECIFIED_MAPPING_FILE_REFS_LIST

static final java.lang.String SPECIFIED_MAPPING_FILE_REFS_LIST
String constant associated with changes to the persistence unit's specified mapping file refs.

See Also:
Constant Field Values

IMPLIED_MAPPING_FILE_REF_PROPERTY

static final java.lang.String IMPLIED_MAPPING_FILE_REF_PROPERTY
String constant associated with changes to the persistence unit's implied mapping file ref.

See Also:
Constant Field Values

JAR_FILE_REFS_LIST

static final java.lang.String JAR_FILE_REFS_LIST
String constant associated with changes to the persistence unit's JAR file refs.

See Also:
Constant Field Values

SPECIFIED_CLASS_REFS_LIST

static final java.lang.String SPECIFIED_CLASS_REFS_LIST
String constant associated with changes to the persistence unit's specified class refs.

See Also:
Constant Field Values

IMPLIED_CLASS_REFS_COLLECTION

static final java.lang.String IMPLIED_CLASS_REFS_COLLECTION
String constant associated with changes to the persistence unit's implied class refs.

See Also:
Constant Field Values

SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY

static final java.lang.String SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY
String constant associated with changes to the persistence unit's "exclude unlisted classes" flag.

See Also:
Constant Field Values

DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY

static final java.lang.String DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY
String constant associated with changes to the persistence unit's default "exclude unlisted classes" flag (not typically changed).

See Also:
Constant Field Values

PROPERTIES_LIST

static final java.lang.String PROPERTIES_LIST
String constant associated with changes to the persistence unit's properties.

See Also:
Constant Field Values

DEFAULT_ACCESS_PROPERTY

static final java.lang.String DEFAULT_ACCESS_PROPERTY
String constant associated with changes to the persistence unit's default access type.

See Also:
Constant Field Values

DEFAULT_CATALOG_PROPERTY

static final java.lang.String DEFAULT_CATALOG_PROPERTY
String constant associated with changes to the persistence unit's default database catalog.

See Also:
Constant Field Values

DEFAULT_SCHEMA_PROPERTY

static final java.lang.String DEFAULT_SCHEMA_PROPERTY
String constant associated with changes to the persistence unit's default database schema.

See Also:
Constant Field Values

DEFAULT_CASCADE_PERSIST_PROPERTY

static final java.lang.String DEFAULT_CASCADE_PERSIST_PROPERTY
String constant associated with changes to the persistence unit's default "cascade persist" flag.

See Also:
Constant Field Values

GENERATORS_LIST

static final java.lang.String GENERATORS_LIST
String constant associated with changes to the persistence unit's list of "global" generators. NB: There are no granular list change notifications; only a "list changed" notification when the list is rebuilt at the finish of the persistence unit's "update".

See Also:
Constant Field Values

QUERIES_LIST

static final java.lang.String QUERIES_LIST
String constant associated with changes to the persistence unit's list of "global" queries. NB: There are no granular list change notifications; only a "list changed" notification when the list is rebuilt at the finish of the persistence unit's "update".

See Also:
Constant Field Values
Method Detail

getParent

Persistence getParent()
Covariant override.

Specified by:
getParent in interface JpaNode

getName

java.lang.String getName()
Return the persistence unit's name.


setName

void setName(java.lang.String name)
Set the persistence unit's name.


getTransactionType

PersistenceUnitTransactionType getTransactionType()
Return the persistence unit's transaction type, whether specified or defaulted.


getSpecifiedTransactionType

PersistenceUnitTransactionType getSpecifiedTransactionType()
Return the persistence unit's specified transaction type.


setSpecifiedTransactionType

void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType)
Set the persistence unit's specified transaction type.


getDefaultTransactionType

PersistenceUnitTransactionType getDefaultTransactionType()
Return the persistence unit's default transaction type.


getDescription

java.lang.String getDescription()
Return the persistence unit's description.


setDescription

void setDescription(java.lang.String description)
Set the persistence unit's description.


getProvider

java.lang.String getProvider()
Return the persistence unit's provider.


setProvider

void setProvider(java.lang.String provider)
Set the persistence unit's provider.


getJtaDataSource

java.lang.String getJtaDataSource()
Return the persistence unit's JTA data source.


setJtaDataSource

void setJtaDataSource(java.lang.String jtaDataSource)
Set the persistence unit's JTA data source.


getNonJtaDataSource

java.lang.String getNonJtaDataSource()
Return the persistence unit's non-JTA data source.


setNonJtaDataSource

void setNonJtaDataSource(java.lang.String nonJtaDataSource)
Set the persistence unit's non-JTA data source.


mappingFileRefs

java.util.ListIterator<MappingFileRef> mappingFileRefs()
Return the persistence unit's list of mapping file refs, both specified and implied.


mappingFileRefsSize

int mappingFileRefsSize()
Return the size of the persistence unit's list of mapping file refs, both specified and implied.


mappingFileRefsContaining

java.util.Iterator<MappingFileRef> mappingFileRefsContaining(java.lang.String typeName)
Return all the mapping file refs, both specified and implied, containing the specified type.


specifiedMappingFileRefs

java.util.ListIterator<MappingFileRef> specifiedMappingFileRefs()
Return the persistence unit's list of specified mapping file refs.


specifiedMappingFileRefsSize

int specifiedMappingFileRefsSize()
Return the size of the persistence unit's list of specified mapping file refs.


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef()
Add a new specified mapping file ref to the persistence unit; return the newly-created mapping file ref.


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef(int index)
Add a new specified mapping file ref to the persistence unit at the specified index; return the newly-created mapping file ref.


removeSpecifiedMappingFileRef

void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef)
Remove the specified mapping file ref from the persistence unit.


removeSpecifiedMappingFileRef

void removeSpecifiedMappingFileRef(int index)
Remove the specified mapping file ref at the specified index from the persistence unit.


getImpliedMappingFileRef

MappingFileRef getImpliedMappingFileRef()
Return the persistence unit's implied mapping file ref.


jarFileRefs

java.util.ListIterator<JarFileRef> jarFileRefs()
Return the persistence unit's list of JAR file refs.


jarFileRefsSize

int jarFileRefsSize()
Return the size of the persistence unit's list of JAR file refs.


addJarFileRef

JarFileRef addJarFileRef()
Add a new JAR file ref to the persistence unit; return the newly-created JAR file ref.


addJarFileRef

JarFileRef addJarFileRef(int index)
Add a new JAR file ref to the persistence unit at the specified index; return the newly-created JAR file ref.


removeJarFileRef

void removeJarFileRef(JarFileRef jarFileRef)
Remove the specified JAR file ref from the persistence unit.


removeJarFileRef

void removeJarFileRef(int index)
Remove the JAR file ref at the specified index from the persistence unit.


classRefs

java.util.Iterator<ClassRef> classRefs()
Return the persistence unit's list of class refs, both specified and implied.


classRefsSize

int classRefsSize()
Return the size of the persistence unit's list of class refs, both specified and implied.


specifiedClassRefs

java.util.ListIterator<ClassRef> specifiedClassRefs()
Return the persistence unit's list of specified class refs.


specifiedClassRefsSize

int specifiedClassRefsSize()
Return the size of the persistence unit's list of specified mapping file refs.


addSpecifiedClassRef

ClassRef addSpecifiedClassRef()
Add a new specified class ref to the persistence unit; return the newly-created class ref.


addSpecifiedClassRef

ClassRef addSpecifiedClassRef(int index)
Add a new specified class ref to the persistence unit at the specified index; return the newly-created class ref.


removeSpecifiedClassRef

void removeSpecifiedClassRef(ClassRef classRef)
Remove the specified class ref from the persistence unit.


removeSpecifiedClassRef

void removeSpecifiedClassRef(int index)
Remove the specified class ref at the specified index from the persistence unit.


impliedClassRefs

java.util.Iterator<ClassRef> impliedClassRefs()
Return the persistence unit's list of implied class refs.


impliedClassRefsSize

int impliedClassRefsSize()
Return the size of the persistence unit's list of implied class refs.


excludesUnlistedClasses

boolean excludesUnlistedClasses()
Return whether the persistence unit excludes unlisted classes.


getSpecifiedExcludeUnlistedClasses

java.lang.Boolean getSpecifiedExcludeUnlistedClasses()
Return the persistence unit's specified "exclude unlisted classes" flag.


setSpecifiedExcludeUnlistedClasses

void setSpecifiedExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
Set the persistence unit's specified "exclude unlisted classes" flag.


getDefaultExcludeUnlistedClasses

boolean getDefaultExcludeUnlistedClasses()
Return whether the persistence unit excludes unlisted classes by default.


properties

java.util.ListIterator<PersistenceUnit.Property> properties()
Return the persistence unit's list of properties.


propertiesSize

int propertiesSize()
Return the size of the persistence unit's list of properties.


getProperty

PersistenceUnit.Property getProperty(java.lang.String propertyName)
Return the *first* property in the persistence unit's property list with the specified name. Return null if the list does not contain a property with the specified name.


propertiesWithNamePrefix

java.util.Iterator<PersistenceUnit.Property> propertiesWithNamePrefix(java.lang.String propertyNamePrefix)
Return the persistence unit's properties with names beginning with the specified prefix.


addProperty

PersistenceUnit.Property addProperty()
Add a new property to the persistence unit; return the newly-created property.


addProperty

PersistenceUnit.Property addProperty(int index)
Add a new property to the persistence unit at the specified index; return the newly-created property.


setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.String value)
Set the value of the *first* property in the persistence unit's property list with the specified name to the specified value, creating a new property if one does not already exist. If a property exists and the specified value is null, the existing property is removed.


setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.String value,
                 boolean duplicatePropertyNamesAllowed)
Set the value of the property with the specified name, creating a new property if one does not exist or if the specified flag indicates duplicate property names are allowed. If a property exists and duplicate values are not allowed and the specified value is null, the existing property is removed.


removeProperty

void removeProperty(PersistenceUnit.Property property)
Remove the specified property from the persistence unit.


removeProperty

void removeProperty(java.lang.String propertyName)
Remove the *first* property in the persistence unit's property list with the specified name.


removeProperty

void removeProperty(java.lang.String propertyName,
                    java.lang.String value)
Remove the *first* property in the persistence unit's property list with the specified name and value, allowing the removal of properties with duplicate property names.


propertyNameChanged

void propertyNameChanged(java.lang.String oldPropertyName,
                         java.lang.String newPropertyName,
                         java.lang.String value)
Call back method for Property name changing.


propertyValueChanged

void propertyValueChanged(java.lang.String propertyName,
                          java.lang.String newValue)
Call back method for Property value changing.


getDefaultAccess

AccessType getDefaultAccess()
Return the default access type from the first persistence unit defaults found in the persistence unit's list of mapping files.


getDefaultCatalog

java.lang.String getDefaultCatalog()
Return the default database catalog from the first persistence unit defaults found in the persistence unit's list of mapping files.


getDefaultSchema

java.lang.String getDefaultSchema()
Return the default database schema from the first persistence unit defaults found in the persistence unit's list of mapping files.


getDefaultCascadePersist

boolean getDefaultCascadePersist()
Return the default "cascade persist" flag from the first persistence unit defaults found in the persistence unit's list of mapping files.


generators

java.util.ListIterator<Generator> generators()
Return the list of generators defined within the persistence unit's scope, including generators with duplicate names.


generatorsSize

int generatorsSize()
Return the size of the list of generators defined within the persistence unit's scope, including generators with duplicate names.


addGenerator

void addGenerator(Generator generator)
Add the specified generator (that is defined elsewhere) to the list of generators defined within the persistence unit's scope. NB: This is to be called by every generator during "update". This method does not directly generate a change notification. The change notification is fired at the end of the persistence unit's "update", once all the generators have added themselves.


uniqueGeneratorNames

java.lang.String[] uniqueGeneratorNames()
Return the names of the generators defined in the persistence unit's scope, with duplicates removed.


queries

java.util.ListIterator<Query> queries()
Return the list of queries defined within the persistence unit's scope, including queries with duplicate names.


queriesSize

int queriesSize()
Return the size of the list of queries defined within the persistence unit's scope, including queries with duplicate names.


addQuery

void addQuery(Query query)
Add the specified query (that is defined elsewhere) to the list of queries defined within the persistence unit's scope. NB: This is to be called by every query during "update". This method does not directly generate a change notification. The change notification is fired at the end of the persistence unit's "update", once all the queries have added themselves.


addRootEntityWithSubEntities

void addRootEntityWithSubEntities(java.lang.String entityName)
The entity with the given name is a root entity that has sub entities. This will be stored by the persistence unit so that the entity can later call entityIsRootWithSubEntities(String)


entityIsRootWithSubEntities

boolean entityIsRootWithSubEntities(java.lang.String entityName)
Return whether the entity with the given name is a root entity that also has sub entities.

See Also:
addRootEntityWithSubEntities(String)

update

void update(XmlPersistenceUnit persistenceUnit)
Update the PersistenceUnit context model object to match the XmlPersistenceUnit resource model object. see JpaProject.update()


getPersistentType

PersistentType getPersistentType(java.lang.String typeName)
Return the persistent type specified in the persistence unit with the specified name.


specifiesPersistentType

boolean specifiesPersistentType(java.lang.String typeName)
Return whether the persistence unit specifies a persistent type with the specified name (i.e. the type is listed either in the persistence unit's list of specified classes or in one of the persistent unit's mapping files).


getEntity

Entity getEntity(java.lang.String typeName)
Return the entity specified in the persistence unit with the specified name. Return null if there is no persistent type with the specified name or if the persistent type is not mapped as an entity.

See Also:
MappingKeys.ENTITY_TYPE_MAPPING_KEY

getEmbeddable

Embeddable getEmbeddable(java.lang.String typeName)
Return the embeddable specified in the persistence unit with the specified name. Return null if there is no persistent type with the specified name or if the persistent type is not mapped as an embeddable.

See Also:
MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY

containsOffset

boolean containsOffset(int textOffset)
Return whether the text representation of this persistence unit contains the given text offset


shouldValidateAgainstDatabase

boolean shouldValidateAgainstDatabase()
Return whether any database metadata specific validation should occur. (For instance, if the connection is not active, then it should not.)