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

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model, PersistentTypeContainer, XmlContextNode
All Known Subinterfaces:
PersistenceUnit2_0
All Known Implementing Classes:
org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit, EclipseLinkPersistenceUnit

public interface PersistenceUnit
extends XmlContextNode, JpaStructureNode, PersistentTypeContainer

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:
3.0

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_COLLECTION
          String constant associated with changes to the persistence unit's collection 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_COLLECTION
          String constant associated with changes to the persistence unit's collection 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
static java.lang.String XML_MAPPING_METADATA_COMPLETE_PROPERTY
          String constant associated with changes to the persistence unit's "XML mapping metadata complete" flag.
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer
TRANSFORMER
 
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(int index, java.lang.String fileName)
          Add a new JAR file ref to the persistence unit at the specified index; return the newly-created JAR file ref.
 JarFileRef addJarFileRef(java.lang.String fileName)
          Add a new JAR file ref to the persistence unit; 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.
 ClassRef addSpecifiedClassRef(int index, java.lang.String className)
          Add a new specified class ref to the persistence unit at the specified index; return the newly-created class ref.
 ClassRef addSpecifiedClassRef(java.lang.String className)
          Add a new specified class ref to the persistence unit; return the newly-created class ref.
 MappingFileRef addSpecifiedMappingFileRef(int index, java.lang.String fileName)
          Add a new specified mapping file ref to the persistence unit at the specified index; return the newly-created mapping file ref.
 MappingFileRef addSpecifiedMappingFileRef(java.lang.String fileName)
          Add a new specified mapping file ref to the persistence unit; 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
 java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteMappingFileEdits(org.eclipse.core.resources.IFile file)
          Create DeleteEdits for deleting any references to the deleted file Return an EmptyIterable if there are not any references.
 java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteTypeEdits(org.eclipse.jdt.core.IType type)
          Create DeleteEdits for deleting any references to the deleted type.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveFolderEdits(org.eclipse.core.resources.IFolder originalFolder, org.eclipse.core.runtime.IPath runtimeDestination)
          Create ReplaceEdits for moving any references to the originalFolder to the runtimeDestination.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveMappingFileEdits(org.eclipse.core.resources.IFile originalFile, org.eclipse.core.runtime.IPath runtineDestination)
          Create ReplaceEdits for moving any references to the originalFile to the destination.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType, org.eclipse.jdt.core.IPackageFragment newPackage)
          Create ReplaceEdits for moving any references to the originalType to the newPackage.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameFolderEdits(org.eclipse.core.resources.IFolder originalFolder, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalFolder to the newName.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameMappingFileEdits(org.eclipse.core.resources.IFile originalFile, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalFile to the newName.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalPackage to the newName.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalType to the newName.
 boolean excludesUnlistedClasses()
          Return whether the persistence unit excludes unlisted classes.
 int findInsertLocationForMappingFileRef()
          Return a location relative to the beginning of the persistence.xml for inserting a new mapping-file element.
 java.util.Iterator<Generator> generators()
          Return the "active" generators defined within the persistence unit's scope, including generators with duplicate names.
 int generatorsSize()
          Return the number of "active" generators defined within the persistence unit's scope.
 AccessType getDefaultAccess()
          Return the default access type from the first persistence unit metadata found in the persistence unit's list of mapping files.
 boolean getDefaultCascadePersist()
          Return the default "cascade persist" flag from the first persistence unit metadata found in the persistence unit's list of mapping files.
 java.lang.String getDefaultCatalog()
          Return the default database catalog from the first persistence unit metadata 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 metadata 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.
 java.lang.Iterable<Entity> getEntities()
          Return the persistence unit's entities.
 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.Iterable<Entity> getJavaEntities()
          Return all the entities defined with both the implied and specified Java classes of a persistence unit
 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.
 java.lang.Iterable<Entity> getOrmEntities()
          Return all the entities defined in both the implied and specified mapping files of a persistence unit
 java.lang.Iterable<java.lang.String> getOrmMappedClassNames()
          Return the class names of all the mapped orm classes cross the persistent unit
 Persistence getParent()
          Covariant override.
 java.lang.Iterable<PersistenceUnit.Property> getPropertiesNamed(java.lang.String propertyName)
          Return all the properties 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.lang.Iterable<java.lang.String> getUniqueGeneratorNames()
          Return the names of the "active" generators defined in the persistence unit's scope, with duplicates removed.
 XmlPersistenceUnit getXmlPersistenceUnit()
          Return the XML resource model corresponding to the persistence unit.
 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.
 boolean isXmlMappingMetadataComplete()
          Return the default "XML mapping metadata complete" flag from the first persistence unit metadata found in the persistence unit's list of mapping files.
 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.Iterator<java.lang.String> javaEntityNames()
          Return the entity names of all the entities defined with both the implied and specified Java classes of a persistence unit
 java.util.Iterator<java.lang.String> javaEntityNamesExclOverridden()
          Return the entity names of entities only defined with mapped Java classes of a persistence unit.
 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> mapEntityNameToClassNames()
          Return a map with entity names as the key and class names as the value.
 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.Iterator<java.lang.String> ormEntityNames()
          Return the entity names of all the entities defined in both the implied and specified mapping files of a persistence unit
 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.Iterator<Query> queries()
          Return the "active" queries defined within the persistence unit's scope, including queries with duplicate names.
 int queriesSize()
          Return the number of "active" queries defined within the persistence unit's scope.
 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.
 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.
 boolean validatesAgainstDatabase()
          Return whether the persistence unit validates agains database metadata.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.XmlContextNode
getValidationTextRange, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, synchronizeWithResourceModel, update
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
getJpaProject, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.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.common.core.IResourcePart
getResource
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer
getPersistentType, getPersistentTypes
 

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

XML_MAPPING_METADATA_COMPLETE_PROPERTY

static final java.lang.String XML_MAPPING_METADATA_COMPLETE_PROPERTY
String constant associated with changes to the persistence unit's "XML mapping metadata complete" flag.

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_COLLECTION

static final java.lang.String GENERATORS_COLLECTION
String constant associated with changes to the persistence unit's collection of "global" generators.

See Also:
Constant Field Values

QUERIES_COLLECTION

static final java.lang.String QUERIES_COLLECTION
String constant associated with changes to the persistence unit's collection of "global" queries.

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(java.lang.String fileName)
Add a new specified mapping file ref to the persistence unit; return the newly-created mapping file ref.


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef(int index,
                                          java.lang.String fileName)
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(java.lang.String fileName)
Add a new JAR file ref to the persistence unit; return the newly-created JAR file ref.


addJarFileRef

JarFileRef addJarFileRef(int index,
                         java.lang.String fileName)
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(java.lang.String className)
Add a new specified class ref to the persistence unit; return the newly-created class ref.


addSpecifiedClassRef

ClassRef addSpecifiedClassRef(int index,
                              java.lang.String className)
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.


getPropertiesNamed

java.lang.Iterable<PersistenceUnit.Property> getPropertiesNamed(java.lang.String propertyName)
Return all the properties in the persistence unit with the specified name. Return an empty Iterable if the persistence unit 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.


isXmlMappingMetadataComplete

boolean isXmlMappingMetadataComplete()
Return the default "XML mapping metadata complete" flag from the first persistence unit metadata found in the persistence unit's list of mapping files.


getDefaultAccess

AccessType getDefaultAccess()
Return the default access type from the first persistence unit metadata 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 metadata 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 metadata found in the persistence unit's list of mapping files.


getDefaultCascadePersist

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


generators

java.util.Iterator<Generator> generators()
Return the "active" generators defined within the persistence unit's scope, including generators with duplicate names. "Active" generators are: NB: A Java generator defined on a class or attribute that is overridden in a mapping file is not, as a result, itself overridden. A Java generator can only be overridden by a mapping file generator with the same name.

NB: A Java generator defined on a class or attribute whose corresponding mapping file mapping (or mapping file) is marked "metadata complete" is ignored.


generatorsSize

int generatorsSize()
Return the number of "active" generators defined within the persistence unit's scope.

See Also:
generators()

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.


getUniqueGeneratorNames

java.lang.Iterable<java.lang.String> getUniqueGeneratorNames()
Return the names of the "active" generators defined in the persistence unit's scope, with duplicates removed.


queries

java.util.Iterator<Query> queries()
Return the "active" queries defined within the persistence unit's scope, including queries with duplicate names. These are very similar to generators.

See Also:
generators()

queriesSize

int queriesSize()
Return the number of "active" queries defined within the persistence unit's scope.

See Also:
queries()

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.


getXmlPersistenceUnit

XmlPersistenceUnit getXmlPersistenceUnit()
Return the XML resource model corresponding to the persistence unit.


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).


getEntities

java.lang.Iterable<Entity> getEntities()
Return the persistence unit's entities.


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


mapEntityNameToClassNames

java.util.Map<java.lang.String,java.util.Set<java.lang.String>> mapEntityNameToClassNames()
Return a map with entity names as the key and class names as the value. Duplicate class names are eliminated.


getOrmMappedClassNames

java.lang.Iterable<java.lang.String> getOrmMappedClassNames()
Return the class names of all the mapped orm classes cross the persistent unit


getOrmEntities

java.lang.Iterable<Entity> getOrmEntities()
Return all the entities defined in both the implied and specified mapping files of a persistence unit


ormEntityNames

java.util.Iterator<java.lang.String> ormEntityNames()
Return the entity names of all the entities defined in both the implied and specified mapping files of a persistence unit


getJavaEntities

java.lang.Iterable<Entity> getJavaEntities()
Return all the entities defined with both the implied and specified Java classes of a persistence unit


javaEntityNames

java.util.Iterator<java.lang.String> javaEntityNames()
Return the entity names of all the entities defined with both the implied and specified Java classes of a persistence unit


javaEntityNamesExclOverridden

java.util.Iterator<java.lang.String> javaEntityNamesExclOverridden()
Return the entity names of entities only defined with mapped Java classes of a persistence unit. The names of Java entities overridden by entities defined in the mapping files are excluded.


validatesAgainstDatabase

boolean validatesAgainstDatabase()
Return whether the persistence unit validates agains database metadata. (For instance, if the connection is not active, then it should not.)


createDeleteTypeEdits

java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteTypeEdits(org.eclipse.jdt.core.IType type)
Create DeleteEdits for deleting any references to the deleted type. Return an EmptyIterable if there are not any references.


createDeleteMappingFileEdits

java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteMappingFileEdits(org.eclipse.core.resources.IFile file)
Create DeleteEdits for deleting any references to the deleted file Return an EmptyIterable if there are not any references.


createRenameTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                             java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalType to the newName. The originalType has not yet been renamed, the newName is the new short name.


createMoveTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                           org.eclipse.jdt.core.IPackageFragment newPackage)
Create ReplaceEdits for moving any references to the originalType to the newPackage. The originalType has not yet been moved.


createRenamePackageEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage,
                                                                                java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalPackage to the newName. The originalPackage has not yet been renamed.


createRenameFolderEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameFolderEdits(org.eclipse.core.resources.IFolder originalFolder,
                                                                               java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalFolder to the newName. The originalFolder has not yet been renamed.


createRenameMappingFileEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameMappingFileEdits(org.eclipse.core.resources.IFile originalFile,
                                                                                    java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalFile to the newName. Return an EmptyIterable if there are not any references. The originalFile has not yet been renamed, the newName is the new short name.


createMoveMappingFileEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveMappingFileEdits(org.eclipse.core.resources.IFile originalFile,
                                                                                  org.eclipse.core.runtime.IPath runtineDestination)
Create ReplaceEdits for moving any references to the originalFile to the destination. Return an EmptyIterable if there are not any references. The originalFile has not been moved yet.


createMoveFolderEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveFolderEdits(org.eclipse.core.resources.IFolder originalFolder,
                                                                             org.eclipse.core.runtime.IPath runtimeDestination)
Create ReplaceEdits for moving any references to the originalFolder to the runtimeDestination. The runtimeDestination already includes the original folder name.


findInsertLocationForMappingFileRef

int findInsertLocationForMappingFileRef()
Return a location relative to the beginning of the persistence.xml for inserting a new mapping-file element. If there are existing mapping files, the location should be after those. If no existing mapping files then make sure the location does not violate the persistence.xml schema.