org.eclipse.jpt.jpa.core.context.orm
Interface EntityMappings

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, MappingFileRoot, Model, PersistentType.Owner, PersistentTypeContainer, XmlContextNode
All Known Subinterfaces:
EclipseLinkEntityMappings

public interface EntityMappings
extends MappingFileRoot, PersistentType.Owner

Context model corresponding to the XML resource model XmlEntityMappings, which corresponds to the entity-mappings element in the orm.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

Field Summary
static java.lang.String DEFAULT_ACCESS_PROPERTY
           
static java.lang.String DEFAULT_CATALOG_PROPERTY
           
static java.lang.String DEFAULT_SCHEMA_PROPERTY
           
static java.lang.String DESCRIPTION_PROPERTY
           
static java.lang.String PACKAGE_PROPERTY
           
static java.lang.String PERSISTENT_TYPES_LIST
           
static java.lang.String SEQUENCE_GENERATORS_LIST
           
static java.lang.String SPECIFIED_ACCESS_PROPERTY
           
static java.lang.String SPECIFIED_CATALOG_PROPERTY
           
static java.lang.String SPECIFIED_SCHEMA_PROPERTY
           
static java.lang.String TABLE_GENERATORS_LIST
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer
TRANSFORMER
 
Method Summary
 OrmPersistentType addPersistentType(java.lang.String mappingKey, java.lang.String className)
           
 OrmSequenceGenerator addSequenceGenerator()
           
 OrmSequenceGenerator addSequenceGenerator(int index)
           
 OrmTableGenerator addTableGenerator()
           
 OrmTableGenerator addTableGenerator(int index)
           
 void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping)
           
 boolean containsOffset(int textOffset)
           
 boolean containsPersistentType(java.lang.String className)
           
 java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteTypeEdits(org.eclipse.jdt.core.IType type)
          Create DeleteEdits for deleting references (if any) to the type about to be deleted.
 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> 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.
 Catalog getDbCatalog()
           
 Schema getDbSchema()
           
 SchemaContainer getDbSchemaContainer()
          Return the database schema container, which can be either a catalog or, if the database does not support catalogs, the database itself.
 AccessType getDefaultAccess()
           
 java.lang.String getDefaultCatalog()
           
 java.lang.String getDefaultPersistentTypePackage()
          Return the default package to be used for persistent types in this context.
 java.lang.String getDefaultSchema()
           
 java.lang.String getDescription()
           
 java.lang.String getPackage()
          "The package subelement specifies the package of the classes listed within the subelements and attributes of the same mapping file only.
 OrmXml getParent()
          Covariant override.
 OrmPersistenceUnitMetadata getPersistenceUnitMetadata()
          Covariant override.
 OrmPersistentType getPersistentType(java.lang.String className)
          Return the persistent type with the specified name.
 org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmPersistentType> getPersistentTypes()
          Covariant override.
 int getPersistentTypesSize()
           
 OrmQueryContainer getQueryContainer()
           
 org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmSequenceGenerator> getSequenceGenerators()
           
 int getSequenceGeneratorsSize()
           
 AccessType getSpecifiedAccess()
           
 java.lang.String getSpecifiedCatalog()
           
 java.lang.String getSpecifiedSchema()
           
 org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmTableGenerator> getTableGenerators()
           
 int getTableGeneratorsSize()
           
 java.lang.String getVersion()
           
 XmlEntityMappings getXmlEntityMappings()
           
 void moveSequenceGenerator(int targetIndex, int sourceIndex)
           
 void moveTableGenerator(int targetIndex, int sourceIndex)
           
 void removePersistentType(int index)
           
 void removePersistentType(OrmPersistentType persistentType)
           
 void removeSequenceGenerator(int index)
           
 void removeSequenceGenerator(OrmSequenceGenerator sequenceGenerator)
           
 void removeTableGenerator(int index)
           
 void removeTableGenerator(OrmTableGenerator tableGenerator)
           
 JavaResourcePersistentType resolveJavaResourcePersistentType(java.lang.String className)
          Return the Java resource persistent type for the specified class name found in the JPA project.
 PersistentType resolvePersistentType(java.lang.String className)
          Return the persistent type for the specified class name found in the persistence unit.
 void setDescription(java.lang.String description)
           
 void setPackage(java.lang.String package_)
           
 void setSpecifiedAccess(AccessType access)
           
 void setSpecifiedCatalog(java.lang.String catalog)
           
 void setSpecifiedSchema(java.lang.String schema)
           
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.MappingFileRoot
getAccess, getCatalog, getSchema
 
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.PersistentType.Owner
getDefaultPersistentTypeAccess, getOverridePersistentTypeAccess
 

Field Detail

DESCRIPTION_PROPERTY

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

PACKAGE_PROPERTY

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

SPECIFIED_ACCESS_PROPERTY

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

DEFAULT_ACCESS_PROPERTY

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

SPECIFIED_CATALOG_PROPERTY

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

DEFAULT_CATALOG_PROPERTY

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

SPECIFIED_SCHEMA_PROPERTY

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

DEFAULT_SCHEMA_PROPERTY

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

PERSISTENT_TYPES_LIST

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

SEQUENCE_GENERATORS_LIST

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

TABLE_GENERATORS_LIST

static final java.lang.String TABLE_GENERATORS_LIST
See Also:
Constant Field Values
Method Detail

getParent

OrmXml getParent()
Covariant override.

Specified by:
getParent in interface JpaNode
Specified by:
getParent in interface MappingFileRoot

getXmlEntityMappings

XmlEntityMappings getXmlEntityMappings()

getVersion

java.lang.String getVersion()

getDescription

java.lang.String getDescription()

setDescription

void setDescription(java.lang.String description)

getPackage

java.lang.String getPackage()
"The package subelement specifies the package of the classes listed within the subelements and attributes of the same mapping file only. The package subelement is overridden if the fully qualified class name is specified for a class and the two disagree."

NB: No mention of how to resolve duplicates in the "default" package or sub-packages:

when package is specified as foo.


setPackage

void setPackage(java.lang.String package_)

getSpecifiedAccess

AccessType getSpecifiedAccess()

setSpecifiedAccess

void setSpecifiedAccess(AccessType access)

getDefaultAccess

AccessType getDefaultAccess()

getDbSchemaContainer

SchemaContainer getDbSchemaContainer()
Return the database schema container, which can be either a catalog or, if the database does not support catalogs, the database itself.


getSpecifiedCatalog

java.lang.String getSpecifiedCatalog()

setSpecifiedCatalog

void setSpecifiedCatalog(java.lang.String catalog)

getDefaultCatalog

java.lang.String getDefaultCatalog()

getDbCatalog

Catalog getDbCatalog()

getSpecifiedSchema

java.lang.String getSpecifiedSchema()

setSpecifiedSchema

void setSpecifiedSchema(java.lang.String schema)

getDefaultSchema

java.lang.String getDefaultSchema()

getDbSchema

Schema getDbSchema()

getPersistenceUnitMetadata

OrmPersistenceUnitMetadata getPersistenceUnitMetadata()
Covariant override.

Specified by:
getPersistenceUnitMetadata in interface MappingFileRoot
See Also:
MappingFilePersistenceUnitMetadata.resourceExists()

getPersistentTypes

org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmPersistentType> getPersistentTypes()
Covariant override.

Specified by:
getPersistentTypes in interface PersistentTypeContainer

getPersistentType

OrmPersistentType getPersistentType(java.lang.String className)
Description copied from interface: PersistentTypeContainer
Return the persistent type with the specified name. Return null if the persistent type is not found. If the persistent unit has more than one persistent type with the specified name, return the first one found, using the following search order:

Specified by:
getPersistentType in interface PersistentTypeContainer

getPersistentTypesSize

int getPersistentTypesSize()

addPersistentType

OrmPersistentType addPersistentType(java.lang.String mappingKey,
                                    java.lang.String className)

removePersistentType

void removePersistentType(int index)

removePersistentType

void removePersistentType(OrmPersistentType persistentType)

containsPersistentType

boolean containsPersistentType(java.lang.String className)

getSequenceGenerators

org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmSequenceGenerator> getSequenceGenerators()

getSequenceGeneratorsSize

int getSequenceGeneratorsSize()

addSequenceGenerator

OrmSequenceGenerator addSequenceGenerator()

addSequenceGenerator

OrmSequenceGenerator addSequenceGenerator(int index)

removeSequenceGenerator

void removeSequenceGenerator(int index)

removeSequenceGenerator

void removeSequenceGenerator(OrmSequenceGenerator sequenceGenerator)

moveSequenceGenerator

void moveSequenceGenerator(int targetIndex,
                           int sourceIndex)

getTableGenerators

org.eclipse.jpt.common.utility.internal.iterables.ListIterable<OrmTableGenerator> getTableGenerators()

getTableGeneratorsSize

int getTableGeneratorsSize()

addTableGenerator

OrmTableGenerator addTableGenerator()

addTableGenerator

OrmTableGenerator addTableGenerator(int index)

removeTableGenerator

void removeTableGenerator(int index)

removeTableGenerator

void removeTableGenerator(OrmTableGenerator tableGenerator)

moveTableGenerator

void moveTableGenerator(int targetIndex,
                        int sourceIndex)

getQueryContainer

OrmQueryContainer getQueryContainer()

getDefaultPersistentTypePackage

java.lang.String getDefaultPersistentTypePackage()
Return the default package to be used for persistent types in this context.


changeMapping

void changeMapping(OrmPersistentType ormPersistentType,
                   OrmTypeMapping oldMapping,
                   OrmTypeMapping newMapping)

containsOffset

boolean containsOffset(int textOffset)

resolveJavaResourcePersistentType

JavaResourcePersistentType resolveJavaResourcePersistentType(java.lang.String className)
Return the Java resource persistent type for the specified class name found in the JPA project. First look for one with the specified name (since it might be fully qualified). If not found, prepend the default package name and try again.

See Also:
getPackage()

resolvePersistentType

PersistentType resolvePersistentType(java.lang.String className)
Return the persistent type for the specified class name found in the persistence unit. First look for one with the specified name (since it might be fully qualified). If not found, prepend the default package name and try again.

See Also:
getPackage()

createDeleteTypeEdits

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


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.