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