Dali Provisional API
Release 3.2

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

All Superinterfaces:
DeleteTypeRefactoringParticipant, IAdaptable, JpaContextModel, JpaModel, JpaStructureNode, JptResourceTypeReference, ManagedTypeContainer, MappingFileRefactoringParticipant, Model, PersistentTypeContainer, TypeRefactoringParticipant
All Known Subinterfaces:
PersistenceUnit2_0
All Known Implementing Classes:
org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit, EclipseLinkPersistenceUnit

public interface PersistenceUnit
extends JpaStructureNode, PersistentTypeContainer, MappingFileRefactoringParticipant, DeleteTypeRefactoringParticipant, TypeRefactoringParticipant

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

Nested Class Summary
static class PersistenceUnit.NameTransformer
           
static interface PersistenceUnit.Property
          Simple property interface.
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
JpaStructureNode.ContextType
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaModel
JpaModel.JpaVersionIsCompatibleWith
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeIsKindOf, JptResourceTypeReference.ResourceTypeTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.PersistentTypeContainer
PersistentTypeContainer.PersistentTypesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.ManagedTypeContainer
ManagedTypeContainer.ContainsType, ManagedTypeContainer.ManagedTypesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.persistence.MappingFileRefactoringParticipant
MappingFileRefactoringParticipant.DeleteMappingFileEditsTransformer, MappingFileRefactoringParticipant.MoveFolderEditsTransformer, MappingFileRefactoringParticipant.MoveMappingFileEditsTransformer, MappingFileRefactoringParticipant.RenameFolderEditsTransformer, MappingFileRefactoringParticipant.RenameMappingFileEditsTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
DeleteTypeRefactoringParticipant.DeleteTypeEditsTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
TypeRefactoringParticipant.MoveTypeEditsTransformer, TypeRefactoringParticipant.RenamePackageEditsTransformer, TypeRefactoringParticipant.RenameTypeEditsTransformer
 
Field Summary
static String DEFAULT_ACCESS_PROPERTY
          String constant associated with changes to the persistence unit's default access type.
static String DEFAULT_CASCADE_PERSIST_PROPERTY
          String constant associated with changes to the persistence unit's default "cascade persist" flag.
static String DEFAULT_CATALOG_PROPERTY
          String constant associated with changes to the persistence unit's default database catalog.
static 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 String DEFAULT_SCHEMA_PROPERTY
          String constant associated with changes to the persistence unit's default database schema.
static String DEFAULT_TRANSACTION_TYPE_PROPERTY
          String constant associated with changes to the persistence unit's default transaction type (not typically changed).
static String DESCRIPTION_PROPERTY
          String constant associated with changes to the persistence unit's description.
static String GENERATORS_COLLECTION
          String constant associated with changes to the persistence unit's collection of "global" generators.
static String IMPLIED_CLASS_REFS_COLLECTION
          String constant associated with changes to the persistence unit's implied class refs.
static String IMPLIED_MAPPING_FILE_REF_PROPERTY
          String constant associated with changes to the persistence unit's implied mapping file ref.
static String JAR_FILE_REFS_LIST
          String constant associated with changes to the persistence unit's JAR file refs.
static String JTA_DATA_SOURCE_PROPERTY
          String constant associated with changes to the persistence unit's JTA data source
static String NAME_PROPERTY
          String constant associated with changes to the persistence unit's name.
static org.eclipse.jpt.common.utility.transformer.Transformer<PersistenceUnit,String> NAME_TRANSFORMER
           
static String NON_JTA_DATA_SOURCE_PROPERTY
          String constant associated with changes to the persistence unit's non-JTA data source
static String PROPERTIES_LIST
          String constant associated with changes to the persistence unit's properties.
static String PROVIDER_PROPERTY
          String constant associated with changes to the persistence unit's provider.
static String QUERIES_COLLECTION
          String constant associated with changes to the persistence unit's collection of "global" queries.
static String SPECIFIED_CLASS_REFS_LIST
          String constant associated with changes to the persistence unit's specified class refs.
static String SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY
          String constant associated with changes to the persistence unit's "exclude unlisted classes" flag.
static String SPECIFIED_MAPPING_FILE_REFS_LIST
          String constant associated with changes to the persistence unit's specified mapping file refs.
static String SPECIFIED_TRANSACTION_TYPE_PROPERTY
          String constant associated with changes to the persistence unit's specified transaction type
static 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.JpaStructureNode
CHILDREN_COLLECTION
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.PersistentTypeContainer
TRANSFORMER
 
Method Summary
 JarFileRef addJarFileRef(int index, 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(String fileName)
          Add a new JAR file ref to the persistence unit; return the newly-created JAR file ref.
 void addPersistentTypes(PersistentType.Config[] typeConfigs, boolean listInPersistenceXml, IProgressMonitor monitor)
          Add types to the persistence unit with the specified names and corresponding mapping types.
 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, String className)
          Add a new specified class ref to the persistence unit at the specified index; return the newly-created class ref.
 ClassRef addSpecifiedClassRef(String className)
          Add a new specified class ref to the persistence unit; return the newly-created class ref.
 MappingFileRef addSpecifiedMappingFileRef(int index, 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(String fileName)
          Add a new specified mapping file ref to the persistence unit; return the newly-created mapping file ref.
 void convertJavaGenerators(EntityMappings entityMappings, IProgressMonitor monitor)
          Convert all "convertible" Java generators to global-level mapping file generators.
 void convertJavaQueries(EntityMappings entityMappings, IProgressMonitor monitor)
          Convert all "convertible" Java queries to global-level mapping file queries.
 JpaJpqlQueryHelper createJpqlQueryHelper()
          Creates a new JpaJpqlQueryHelper that provides functionality related to JPQL queries.
 void dispose()
           
 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.
 Iterable<ClassRef> getClassRefs()
          Return the persistence unit's list of class refs, both specified and implied.
 int getClassRefsSize()
          Return the size of the persistence unit's list of class refs, both specified and implied.
 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.
 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.
 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.
 String getDescription()
          Return the persistence unit's description.
 Embeddable getEmbeddable(String typeName)
          Return the embeddable specified in the persistence unit with the specified name.
 Iterable<Entity> getEntities()
          Return the persistence unit's entities.
 Entity getEntity(String typeName)
          Return the entity specified in the persistence unit with the specified name.
 Iterable<Generator> getGenerators()
          Return the "active" generators defined within the persistence unit's scope, including generators with duplicate names.
 int getGeneratorsSize()
          Return the number of "active" generators defined within the persistence unit's scope.
 Iterable<ClassRef> getImpliedClassRefs()
          Return the persistence unit's list of implied class refs.
 int getImpliedClassRefsSize()
          Return the size of the persistence unit's list of implied class refs.
 MappingFileRef getImpliedMappingFileRef()
          Return the persistence unit's implied mapping file ref.
 org.eclipse.jpt.common.utility.iterable.ListIterable<JarFileRef> getJarFileRefs()
          Return the persistence unit's list of JAR file refs.
 int getJarFileRefsSize()
          Return the size of the persistence unit's list of JAR file refs.
 Iterable<PersistentType> getJavaPersistentTypes()
          Return the persistence unit's Java persistent types, as specified by the class refs (both specified and implied) and jar files.
 String getJtaDataSource()
          Return the persistence unit's JTA data source.
 org.eclipse.jpt.common.utility.iterable.ListIterable<MappingFileRef> getMappingFileRefs()
          Return the persistence unit's list of mapping file refs, both specified and implied.
 Iterable<MappingFileRef> getMappingFileRefsContaining(String typeName)
          Return all the mapping file refs, both specified and implied, containing the specified type.
 int getMappingFileRefsSize()
          Return the size of the persistence unit's list of mapping file refs, both specified and implied.
 String getName()
          Return the persistence unit's name.
 String getNonJtaDataSource()
          Return the persistence unit's non-JTA data source.
 Iterable<String> getPackageNames()
          Return the names of all the packages valid cross the persistence unit including the ones from jar files
 Persistence getParent()
          Covariant override.
 org.eclipse.jpt.common.utility.iterable.ListIterable<PersistenceUnit.Property> getProperties()
          Return the persistence unit's list of properties.
 Iterable<PersistenceUnit.Property> getPropertiesNamed(String propertyName)
          Return all the properties in the persistence unit with the specified name.
 int getPropertiesSize()
          Return the size of the persistence unit's list of properties.
 Iterable<PersistenceUnit.Property> getPropertiesWithNamePrefix(String propertyNamePrefix)
          Return the persistence unit's properties with names beginning with the specified prefix.
 PersistenceUnit.Property getProperty(String propertyName)
          Return the *first* property in the persistence unit's property list with the specified name.
 String getProvider()
          Return the persistence unit's provider.
 Iterable<Query> getQueries()
          Return the "active" queries defined within the persistence unit's scope, including queries with duplicate names.
 int getQueriesSize()
          Return the number of "active" queries defined within the persistence unit's scope.
 org.eclipse.jpt.common.utility.iterable.ListIterable<ClassRef> getSpecifiedClassRefs()
          Return the persistence unit's list of specified class refs.
 int getSpecifiedClassRefsSize()
          Return the size of the persistence unit's list of specified mapping file refs.
 Boolean getSpecifiedExcludeUnlistedClasses()
          Return the persistence unit's specified "exclude unlisted classes" flag.
 org.eclipse.jpt.common.utility.iterable.ListIterable<MappingFileRef> getSpecifiedMappingFileRefs()
          Return the persistence unit's list of specified mapping file refs.
 int getSpecifiedMappingFileRefsSize()
          Return the size of the persistence unit's list of specified mapping file refs.
 PersistenceUnitTransactionType getSpecifiedTransactionType()
          Return the persistence unit's specified transaction type.
 PersistenceUnitTransactionType getTransactionType()
          Return the persistence unit's transaction type, whether specified or defaulted.
 Iterable<String> getUniqueGeneratorNames()
          Return the names of the "active" generators defined in the persistence unit's scope, with duplicates removed.
 org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit getXmlPersistenceUnit()
          Return the XML resource model corresponding to the persistence unit.
 boolean hasConvertibleJavaGenerators()
          Return whether the persistence unit contains any "convertible" generators (i.e.
 boolean hasConvertibleJavaQueries()
          Return whether the persistence unit contains any "convertible" queries.
 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.
 void propertyNameChanged(String oldPropertyName, String newPropertyName, String value)
          Call back method for Property name changing.
 void propertyValueChanged(String propertyName, String newValue)
          Call back method for Property value changing.
 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(String propertyName)
          Remove the *first* property in the persistence unit's property list with the specified name.
 void removeProperty(String propertyName, 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 removeSpecifiedClassRefs(Iterable<ClassRef> classRefs)
          Remove the specified class refs 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(String description)
          Set the persistence unit's description.
 void setJtaDataSource(String jtaDataSource)
          Set the persistence unit's JTA data source.
 void setName(String name)
          Set the persistence unit's name.
 void setNonJtaDataSource(String nonJtaDataSource)
          Set the persistence unit's non-JTA data source.
 void setProperty(String propertyName, 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(String propertyName, 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(String provider)
          Set the persistence unit's provider.
 void setSpecifiedExcludeUnlistedClasses(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 specifiesManagedType(String typeName)
          Return whether the persistence unit specifies a managed 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).
 void synchronizeClasses(IProgressMonitor monitor)
          Synchronize the persistence unit's list of specified classes with the types in the project currently annotated.
 boolean validatesAgainstDatabase()
          Return whether the persistence unit validates agains database metadata.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
addRootStructureNodesTo, containsOffset, getChildren, getChildrenSize, getContextType, getFullTextRange, getSelectionTextRange, getStructureNode, getType
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextModel
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getValidationTextRange, synchronizeWithResourceModel, update, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaModel
getJpaPlatform, getJpaProject, getJpaProjectManager, getResource, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
getResourceType
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.PersistentTypeContainer
getPersistentType, getPersistentTypes
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ManagedTypeContainer
getManagedType, getManagedTypes
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.persistence.MappingFileRefactoringParticipant
createDeleteMappingFileEdits, createMoveFolderEdits, createMoveMappingFileEdits, createRenameFolderEdits, createRenameMappingFileEdits
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
createDeleteTypeEdits
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
createMoveTypeEdits, createRenamePackageEdits, createRenameTypeEdits
 

Field Detail

NAME_PROPERTY

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

See Also:
Constant Field Values

NAME_TRANSFORMER

static final org.eclipse.jpt.common.utility.transformer.Transformer<PersistenceUnit,String> NAME_TRANSFORMER

SPECIFIED_TRANSACTION_TYPE_PROPERTY

static final 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 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 String DESCRIPTION_PROPERTY
String constant associated with changes to the persistence unit's description.

See Also:
Constant Field Values

PROVIDER_PROPERTY

static final 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 JpaContextModel
Specified by:
getParent in interface JpaModel

getName

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


setName

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


createJpqlQueryHelper

JpaJpqlQueryHelper createJpqlQueryHelper()
Creates a new JpaJpqlQueryHelper that provides functionality related to JPQL queries.


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

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


setDescription

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


getProvider

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


setProvider

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


getJtaDataSource

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


setJtaDataSource

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


getNonJtaDataSource

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


setNonJtaDataSource

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


getMappingFileRefs

org.eclipse.jpt.common.utility.iterable.ListIterable<MappingFileRef> getMappingFileRefs()
Return the persistence unit's list of mapping file refs, both specified and implied.


getMappingFileRefsSize

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


getMappingFileRefsContaining

Iterable<MappingFileRef> getMappingFileRefsContaining(String typeName)
Return all the mapping file refs, both specified and implied, containing the specified type.


getSpecifiedMappingFileRefs

org.eclipse.jpt.common.utility.iterable.ListIterable<MappingFileRef> getSpecifiedMappingFileRefs()
Return the persistence unit's list of specified mapping file refs.


getSpecifiedMappingFileRefsSize

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


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef(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,
                                          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.


getJarFileRefs

org.eclipse.jpt.common.utility.iterable.ListIterable<JarFileRef> getJarFileRefs()
Return the persistence unit's list of JAR file refs.


getJarFileRefsSize

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


addJarFileRef

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


addJarFileRef

JarFileRef addJarFileRef(int index,
                         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.


getClassRefs

Iterable<ClassRef> getClassRefs()
Return the persistence unit's list of class refs, both specified and implied.


getClassRefsSize

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


getSpecifiedClassRefs

org.eclipse.jpt.common.utility.iterable.ListIterable<ClassRef> getSpecifiedClassRefs()
Return the persistence unit's list of specified class refs.


getSpecifiedClassRefsSize

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


addSpecifiedClassRef

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


addSpecifiedClassRef

ClassRef addSpecifiedClassRef(int index,
                              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.


removeSpecifiedClassRefs

void removeSpecifiedClassRefs(Iterable<ClassRef> classRefs)
Remove the specified class refs from the persistence unit.


removeSpecifiedClassRef

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


getImpliedClassRefs

Iterable<ClassRef> getImpliedClassRefs()
Return the persistence unit's list of implied class refs.


getImpliedClassRefsSize

int getImpliedClassRefsSize()
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

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


setSpecifiedExcludeUnlistedClasses

void setSpecifiedExcludeUnlistedClasses(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.


getProperties

org.eclipse.jpt.common.utility.iterable.ListIterable<PersistenceUnit.Property> getProperties()
Return the persistence unit's list of properties.


getPropertiesSize

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


getProperty

PersistenceUnit.Property getProperty(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

Iterable<PersistenceUnit.Property> getPropertiesNamed(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.


getPropertiesWithNamePrefix

Iterable<PersistenceUnit.Property> getPropertiesWithNamePrefix(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(String propertyName,
                 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(String propertyName,
                 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(String propertyName)
Remove the *first* property in the persistence unit's property list with the specified name.


removeProperty

void removeProperty(String propertyName,
                    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(String oldPropertyName,
                         String newPropertyName,
                         String value)
Call back method for Property name changing.


propertyValueChanged

void propertyValueChanged(String propertyName,
                          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

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


getDefaultSchema

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.


getGenerators

Iterable<Generator> getGenerators()
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.


getGeneratorsSize

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

See Also:
getGenerators()

getUniqueGeneratorNames

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


hasConvertibleJavaGenerators

boolean hasConvertibleJavaGenerators()
Return whether the persistence unit contains any "convertible" generators (i.e. Java generators that are neither overridden nor [erroneously] duplicated).

See Also:
convertJavaGenerators(EntityMappings, IProgressMonitor)

convertJavaGenerators

void convertJavaGenerators(EntityMappings entityMappings,
                           IProgressMonitor monitor)
Convert all "convertible" Java generators to global-level mapping file generators.

See Also:
hasConvertibleJavaGenerators()

getQueries

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

See Also:
getGenerators()

getQueriesSize

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

See Also:
getQueries()

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.


hasConvertibleJavaQueries

boolean hasConvertibleJavaQueries()
Return whether the persistence unit contains any "convertible" queries. (i.e. Java queries that are neither overridden nor [erroneously] duplicated - by default, any Java queries with the same name are "duplicates").

See Also:
convertJavaQueries(EntityMappings, IProgressMonitor)

convertJavaQueries

void convertJavaQueries(EntityMappings entityMappings,
                        IProgressMonitor monitor)
Convert all "convertible" Java queries to global-level mapping file queries.

See Also:
hasConvertibleJavaQueries()

addPersistentTypes

void addPersistentTypes(PersistentType.Config[] typeConfigs,
                        boolean listInPersistenceXml,
                        IProgressMonitor monitor)
Add types to the persistence unit with the specified names and corresponding mapping types.


getXmlPersistenceUnit

org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit getXmlPersistenceUnit()
Return the XML resource model corresponding to the persistence unit.


specifiesManagedType

boolean specifiesManagedType(String typeName)
Return whether the persistence unit specifies a managed 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).


getJavaPersistentTypes

Iterable<PersistentType> getJavaPersistentTypes()
Return the persistence unit's Java persistent types, as specified by the class refs (both specified and implied) and jar files. There can be duplicate types, and any of them may be overridden by a mapping file persistence type.


getEntities

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


getEntity

Entity getEntity(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(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

synchronizeClasses

void synchronizeClasses(IProgressMonitor monitor)
Synchronize the persistence unit's list of specified classes with the types in the project currently annotated.


getPackageNames

Iterable<String> getPackageNames()
Return the names of all the packages valid cross the persistence unit including the ones from jar files


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.


validatesAgainstDatabase

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


dispose

void dispose()

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.