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

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

public interface Persistence
extends XmlContextNode, JpaStructureNode

The persistence element in the JPA persistence.xml file.

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

Since:
2.0
Version:
2.1

Field Summary
static java.lang.String PERSISTENCE_UNITS_LIST
          String constant associated with changes to the persistence units list
 
Method Summary
 PersistenceUnit addPersistenceUnit()
          Add a persistence unit to the persistence node and return the object representing it.
 PersistenceUnit addPersistenceUnit(int index)
          Add a persistence unit to the persistence node at the specified index and return the object representing it.
 boolean containsOffset(int textOffset)
          Return whether the text representation of this persistence contains the given text offset
 PersistenceXml getParent()
          Covariant override.
 XmlPersistence getXmlPersistence()
          Return the resource model object associated with this context model object
 java.util.ListIterator<PersistenceUnit> persistenceUnits()
          Return an iterator on the list of persistence units.
 int persistenceUnitsSize()
          Return the size of the persistence unit list.
 void removePersistenceUnit(int index)
          Remove the persistence unit at the specified index from the persistence node.
 void removePersistenceUnit(PersistenceUnit persistenceUnit)
          Remove the persistence unit from the persistence node.
 void update(XmlPersistence persistence)
          Update the Persistence context model object to match the XmlPersistence resource model object.
 
Methods inherited from interface org.eclipse.jpt.core.context.XmlContextNode
getValidationTextRange, validate
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, postUpdate
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 

Field Detail

PERSISTENCE_UNITS_LIST

static final java.lang.String PERSISTENCE_UNITS_LIST
String constant associated with changes to the persistence units list

See Also:
Constant Field Values
Method Detail

getXmlPersistence

XmlPersistence getXmlPersistence()
Return the resource model object associated with this context model object


getParent

PersistenceXml getParent()
Covariant override.

Specified by:
getParent in interface JpaNode

persistenceUnits

java.util.ListIterator<PersistenceUnit> persistenceUnits()
Return an iterator on the list of persistence units. This will not be null.


persistenceUnitsSize

int persistenceUnitsSize()
Return the size of the persistence unit list.

Returns:

addPersistenceUnit

PersistenceUnit addPersistenceUnit()
Add a persistence unit to the persistence node and return the object representing it.


addPersistenceUnit

PersistenceUnit addPersistenceUnit(int index)
Add a persistence unit to the persistence node at the specified index and return the object representing it.


removePersistenceUnit

void removePersistenceUnit(PersistenceUnit persistenceUnit)
Remove the persistence unit from the persistence node.


removePersistenceUnit

void removePersistenceUnit(int index)
Remove the persistence unit at the specified index from the persistence node.


update

void update(XmlPersistence persistence)
Update the Persistence context model object to match the XmlPersistence resource model object. see JpaProject.update()


containsOffset

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