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

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, JpaContextNode, JpaNode, JpaStructureNode, Model, PersistenceJpaContextNode

public interface PersistenceUnit
extends PersistenceJpaContextNode, JpaStructureNode

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.


Field Summary
static java.lang.String DEFAULT_ACCESS_PROPERTY
           
static java.lang.String DEFAULT_CASCADE_PERSIST_PROPERTY
           
static java.lang.String DEFAULT_CATALOG_PROPERTY
           
static java.lang.String DEFAULT_EXCLUDE_UNLISTED_CLASSED_PROPERTY
          String constant associated with changes to the persistence unit's default "exclude unlisted classes" setting (not typically changed)
static java.lang.String DEFAULT_SCHEMA_PROPERTY
           
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
          Identifier for changes to the list of global generators.
static java.lang.String IMPLIED_CLASS_REF_LIST
          String constant associated with changes to the implied class refs list
static java.lang.String IMPLIED_MAPPING_FILE_REF_PROPERTY
          String constant associated with changes to the implied mapping file ref
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 properties list
static java.lang.String PROVIDER_PROPERTY
          String constant associated with changes to the persistence unit's provider
static java.lang.String QUERIES_LIST
          Identifier for changes to the list of global queries.
static java.lang.String SPECIFIED_CLASS_REF_LIST
          String constant associated with changes to the specified class refs list
static java.lang.String SPECIFIED_EXCLUDE_UNLISTED_CLASSED_PROPERTY
          String constant associated with changes to the persistence unit's "exclude unlisted classes" setting
static java.lang.String SPECIFIED_MAPPING_FILE_REF_LIST
          String constant associated with changes to the specified mapping file refs list
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 generator (defined elsewhere) to the list of generators defined within this persistence unit.
 Property addProperty()
          Add a property to the persistence unit and return the object representing it.
 Property addProperty(int index)
           
 void addQuery(Query query)
          Add the query (defined elsewhere) to the list of queries defined within this persistence unit.
 ClassRef addSpecifiedClassRef()
          Add a specified class ref to the persistence unit and return the object representing it.
 ClassRef addSpecifiedClassRef(int index)
          Add a specified class ref to the persistence unit at the specified index and return the object representing it.
 MappingFileRef addSpecifiedMappingFileRef()
          Add a specified mapping file ref to the persistence unit and return the object representing it.
 MappingFileRef addSpecifiedMappingFileRef(int index)
          Add a specified mapping file ref to the persistence unit at the specified index and return the object representing it.
 java.util.ListIterator<Generator> allGenerators()
          Return an iterator on all generators defined within this persistence unit, included duplicately named generators.
 java.util.ListIterator<Query> allQueries()
          Return an iterator on all queries defined within this persistence unit, included duplicately named queries.
 java.util.ListIterator<ClassRef> classRefs()
          Return an iterator on the list of class refs, whether specified or implied.
 int classRefsSize()
          Return the number of specified and implied class refs.
 boolean containsOffset(int textOffset)
          Return whether the text representation of this persistence unit contains the given text offset
 boolean containsProperty(java.lang.String key)
           
 AccessType getDefaultAccess()
           
 boolean getDefaultCascadePersist()
           
 java.lang.String getDefaultCatalog()
           
 boolean getDefaultExcludeUnlistedClasses()
          Return the default "exclude unlisted classes" setting
 java.lang.String getDefaultSchema()
           
 PersistenceUnitTransactionType getDefaultTransactionType()
          Return the default transaction type
 java.lang.String getDescription()
          Return the description of the persistence unit.
 MappingFileRef getImpliedMappingFileRef()
          Return the current implied mapping file ref.
 java.lang.String getJtaDataSource()
          Return the JTA data source of the persistence unit.
 java.lang.String getName()
          Return the name of the persistence unit.
 java.lang.String getNonJtaDataSource()
          Return the non-JTA data source of the persistence unit.
 Persistence getParent()
          Return the JPA node's parent.
 PersistentType getPersistentType(java.lang.String fullyQualifiedTypeName)
          Return the PersistentType specified in this PersistenceUnit with the given fully qualified type name
 Property getProperty(java.lang.String key)
           
 Property getProperty(java.lang.String key, java.lang.String value)
           
 java.lang.String getProvider()
          Return the provider of the persistence unit.
 java.lang.Boolean getSpecifiedExcludeUnlistedClasses()
          Return the "exclude unlisted classes" setting of the persistence unit.
 PersistenceUnitTransactionType getSpecifiedTransactionType()
          Return the transaction type of the persistence unit, one of the values of PersistenceUnitTransactionType
 PersistenceUnitTransactionType getTransactionType()
           
 java.util.ListIterator<ClassRef> impliedClassRefs()
          Return an iterator on the list of implied class refs.
 int impliedClassRefsSize()
          Return the number of implied class refs.
 boolean isExcludeUnlistedClasses()
          Return the "exclude unlisted classes" setting of the persistence unit.
 java.util.ListIterator<MappingFileRef> mappingFileRefs()
          Return an iterator on the list of mapping file refs, whether specified or implied.
 int mappingFileRefsSize()
          Return of mapping file refs, specified and implied.
 java.util.ListIterator<Property> properties()
          Return an iterator on the list of properties.
 int propertiesSize()
           
 java.util.ListIterator<Property> propertiesWithPrefix(java.lang.String keyPrefix)
           
 void putProperty(java.lang.String key, java.lang.String value, boolean allowDuplicates)
           
 void removeProperty(Property property)
          Remove the property from the persistence unit.
 void removeProperty(java.lang.String key)
          Remove the property with the given key from the persistence unit.
 void removeProperty(java.lang.String key, java.lang.String value)
          Remove the property with the given key and valuefrom the persistence unit.
 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 replacePropertyValue(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)
           
 void setDescription(java.lang.String description)
          Set the description of the persistence unit.
 void setJtaDataSource(java.lang.String jtaDataSource)
          Set the JTA data source of the persistence unit.
 void setName(java.lang.String name)
          Set the name of the persistence unit.
 void setNonJtaDataSource(java.lang.String nonJtaDataSource)
          Set the non-JTA data source of the persistence unit.
 void setProvider(java.lang.String provider)
          Set the provider of the persistence unit.
 void setSpecifiedExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
          Set the "exclude unlisted classes" setting of the persistence unit.
 void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType)
          Set the transaction type of the persistence unit, one of the values of PersistenceUnitTransactionType
 java.util.ListIterator<ClassRef> specifiedClassRefs()
          Return an iterator on the list of specified class refs.
 int specifiedClassRefsSize()
          Return the number of specified class refs.
 java.util.ListIterator<MappingFileRef> specifiedMappingFileRefs()
          Return an iterator on the list of specified mapping file refs.
 int specifiedMappingFileRefsSize()
          Return of specified mapping file refs.
 void update(XmlPersistenceUnit persistenceUnit)
           
 
Methods inherited from interface org.eclipse.jpt.core.context.persistence.PersistenceJpaContextNode
addToMessages, getValidationTextRange
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getEntityMappings, getOrmPersistentType, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getResource
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, 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_REF_LIST

static final java.lang.String SPECIFIED_MAPPING_FILE_REF_LIST
String constant associated with changes to the specified mapping file refs list

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 implied mapping file ref

See Also:
Constant Field Values

SPECIFIED_CLASS_REF_LIST

static final java.lang.String SPECIFIED_CLASS_REF_LIST
String constant associated with changes to the specified class refs list

See Also:
Constant Field Values

IMPLIED_CLASS_REF_LIST

static final java.lang.String IMPLIED_CLASS_REF_LIST
String constant associated with changes to the implied class refs list

See Also:
Constant Field Values

SPECIFIED_EXCLUDE_UNLISTED_CLASSED_PROPERTY

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

See Also:
Constant Field Values

DEFAULT_EXCLUDE_UNLISTED_CLASSED_PROPERTY

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

See Also:
Constant Field Values

PROPERTIES_LIST

static final java.lang.String PROPERTIES_LIST
String constant associated with changes to the properties list

See Also:
Constant Field Values

DEFAULT_SCHEMA_PROPERTY

static final java.lang.String DEFAULT_SCHEMA_PROPERTY
See Also:
Constant Field Values

DEFAULT_CATALOG_PROPERTY

static final java.lang.String DEFAULT_CATALOG_PROPERTY
See Also:
Constant Field Values

DEFAULT_ACCESS_PROPERTY

static final java.lang.String DEFAULT_ACCESS_PROPERTY
See Also:
Constant Field Values

DEFAULT_CASCADE_PERSIST_PROPERTY

static final java.lang.String DEFAULT_CASCADE_PERSIST_PROPERTY
See Also:
Constant Field Values

GENERATORS_LIST

static final java.lang.String GENERATORS_LIST
Identifier for changes to the list of global generators. Note that there are no granular changes to this list. There is only notification that the entire list has changed.

See Also:
Constant Field Values

QUERIES_LIST

static final java.lang.String QUERIES_LIST
Identifier for changes to the list of global queries. Note that there are no granular changes to this list. There is only notification that the entire list has changed.

See Also:
Constant Field Values
Method Detail

getParent

Persistence getParent()
Description copied from interface: JpaNode
Return the JPA node's parent. The JPA project will not have a parent.

Specified by:
getParent in interface JpaNode

getName

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


setName

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


getTransactionType

PersistenceUnitTransactionType getTransactionType()

getSpecifiedTransactionType

PersistenceUnitTransactionType getSpecifiedTransactionType()
Return the transaction type of the persistence unit, one of the values of PersistenceUnitTransactionType


setSpecifiedTransactionType

void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType)
Set the transaction type of the persistence unit, one of the values of PersistenceUnitTransactionType


getDefaultTransactionType

PersistenceUnitTransactionType getDefaultTransactionType()
Return the default transaction type


getDescription

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


setDescription

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


getProvider

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


setProvider

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


getJtaDataSource

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


setJtaDataSource

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


getNonJtaDataSource

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


setNonJtaDataSource

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


mappingFileRefs

java.util.ListIterator<MappingFileRef> mappingFileRefs()
Return an iterator on the list of mapping file refs, whether specified or implied. This will not be null.


mappingFileRefsSize

int mappingFileRefsSize()
Return of mapping file refs, specified and implied.


specifiedMappingFileRefs

java.util.ListIterator<MappingFileRef> specifiedMappingFileRefs()
Return an iterator on the list of specified mapping file refs. This will not be null.


specifiedMappingFileRefsSize

int specifiedMappingFileRefsSize()
Return of specified mapping file refs.


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef()
Add a specified mapping file ref to the persistence unit and return the object representing it.


addSpecifiedMappingFileRef

MappingFileRef addSpecifiedMappingFileRef(int index)
Add a specified mapping file ref to the persistence unit at the specified index and return the object representing it.


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 current implied mapping file ref. This may be null.


classRefs

java.util.ListIterator<ClassRef> classRefs()
Return an iterator on the list of class refs, whether specified or implied. This will not be null.


classRefsSize

int classRefsSize()
Return the number of specified and implied class refs.


specifiedClassRefs

java.util.ListIterator<ClassRef> specifiedClassRefs()
Return an iterator on the list of specified class refs. This will not be null.


specifiedClassRefsSize

int specifiedClassRefsSize()
Return the number of specified class refs.


addSpecifiedClassRef

ClassRef addSpecifiedClassRef()
Add a specified class ref to the persistence unit and return the object representing it.


addSpecifiedClassRef

ClassRef addSpecifiedClassRef(int index)
Add a specified class ref to the persistence unit at the specified index and return the object representing it.


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.ListIterator<ClassRef> impliedClassRefs()
Return an iterator on the list of implied class refs. This will not be null.


impliedClassRefsSize

int impliedClassRefsSize()
Return the number of implied class refs.


isExcludeUnlistedClasses

boolean isExcludeUnlistedClasses()
Return the "exclude unlisted classes" setting of the persistence unit.


getSpecifiedExcludeUnlistedClasses

java.lang.Boolean getSpecifiedExcludeUnlistedClasses()
Return the "exclude unlisted classes" setting of the persistence unit.


setSpecifiedExcludeUnlistedClasses

void setSpecifiedExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
Set the "exclude unlisted classes" setting of the persistence unit.


getDefaultExcludeUnlistedClasses

boolean getDefaultExcludeUnlistedClasses()
Return the default "exclude unlisted classes" setting


properties

java.util.ListIterator<Property> properties()
Return an iterator on the list of properties. This will not be null.


propertiesSize

int propertiesSize()

addProperty

Property addProperty()
Add a property to the persistence unit and return the object representing it.


addProperty

Property addProperty(int index)

getProperty

Property getProperty(java.lang.String key)

getProperty

Property getProperty(java.lang.String key,
                     java.lang.String value)

propertiesWithPrefix

java.util.ListIterator<Property> propertiesWithPrefix(java.lang.String keyPrefix)

putProperty

void putProperty(java.lang.String key,
                 java.lang.String value,
                 boolean allowDuplicates)

replacePropertyValue

void replacePropertyValue(java.lang.String key,
                          java.lang.String oldValue,
                          java.lang.String newValue)

containsProperty

boolean containsProperty(java.lang.String key)

removeProperty

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


removeProperty

void removeProperty(java.lang.String key)
Remove the property with the given key from the persistence unit.


removeProperty

void removeProperty(java.lang.String key,
                    java.lang.String value)
Remove the property with the given key and valuefrom the persistence unit.


getDefaultSchema

java.lang.String getDefaultSchema()

getDefaultCatalog

java.lang.String getDefaultCatalog()

getDefaultAccess

AccessType getDefaultAccess()

getDefaultCascadePersist

boolean getDefaultCascadePersist()

addGenerator

void addGenerator(Generator generator)
Add the generator (defined elsewhere) to the list of generators defined within this persistence unit. Note that this should only be called during the process of updating the local generator definition. No change notification accompanies this action specifically.


allGenerators

java.util.ListIterator<Generator> allGenerators()
Return an iterator on all generators defined within this persistence unit, included duplicately named generators.


addQuery

void addQuery(Query query)
Add the query (defined elsewhere) to the list of queries defined within this persistence unit. Note that this should only be called during the process of updating the local query definition. No change notification accompanies this action specifically.


allQueries

java.util.ListIterator<Query> allQueries()
Return an iterator on all queries defined within this persistence unit, included duplicately named queries.


update

void update(XmlPersistenceUnit persistenceUnit)

getPersistentType

PersistentType getPersistentType(java.lang.String fullyQualifiedTypeName)
Return the PersistentType specified in this PersistenceUnit with the given fully qualified type name


containsOffset

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