org.eclipse.jpt.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, JpaStructureNode, PersistentType.Owner, PersistentTypeContainer

Context orm.xml entity mappings. 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:
2.3

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
           
 
Method Summary
 OrmPersistentType addPersistentType(java.lang.String mappingKey, java.lang.String className)
           
 OrmSequenceGenerator addSequenceGenerator(int index)
           
 OrmTableGenerator addTableGenerator(int index)
           
 void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping)
           
 boolean containsOffset(int textOffset)
           
 boolean containsPersistentType(java.lang.String fullyQualifiedTypeName)
           
 AccessType getAccess()
          Return the specified access if present, otherwise return the default access.
 java.lang.String getCatalog()
          Return the specified catalog if present, otherwise return the default catalog.
 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()
           
 OrmPersistenceUnitDefaults getPersistenceUnitDefaults()
          Return the defaults defined within this mapping file *for the persistence unit*.
 PersistenceUnitMetadata getPersistenceUnitMetadata()
           
 OrmPersistentType getPersistentType(java.lang.String fullyQualifiedTypeName)
          Return the {@link OrmPersistentType) listed in this mapping file with the given fully qualified type name.
 org.eclipse.jpt.utility.internal.iterables.ListIterable<OrmPersistentType> getPersistentTypes()
          Return the container's persistent types.
 int getPersistentTypesSize()
           
 OrmQueryContainer getQueryContainer()
           
 java.lang.String getSchema()
          Return the specified schema if present, otherwise return the default schema.
 org.eclipse.jpt.utility.internal.iterables.ListIterable<OrmSequenceGenerator> getSequenceGenerators()
           
 int getSequenceGeneratorsSize()
           
 AccessType getSpecifiedAccess()
           
 java.lang.String getSpecifiedCatalog()
           
 java.lang.String getSpecifiedSchema()
           
 org.eclipse.jpt.utility.internal.iterables.ListIterable<OrmTableGenerator> getTableGenerators()
           
 int getTableGeneratorsSize()
           
 java.lang.String getVersion()
           
 XmlEntityMappings getXmlEntityMappings()
           
 boolean isDefaultPersistentTypeMetadataComplete()
          Return the default metadata complete value for persistent types in this context
 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 JavaResourcePersistentType for the given class name found in the JPA project.
 PersistentType resolvePersistentType(java.lang.String className)
          Return the PersistentType for the given class name found in the persistence unit.
 void setDescription(java.lang.String newDescription)
           
 void setPackage(java.lang.String newPackage)
           
 void setSpecifiedAccess(AccessType access)
           
 void setSpecifiedCatalog(java.lang.String catalog)
           
 void setSpecifiedSchema(java.lang.String schema)
           
 void update()
          Update the EntityMappings context model object to match the XmlEntityMappings 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, getParent
 
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
 
Methods inherited from interface org.eclipse.jpt.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

getXmlEntityMappings

XmlEntityMappings getXmlEntityMappings()

getVersion

java.lang.String getVersion()

getDescription

java.lang.String getDescription()

setDescription

void setDescription(java.lang.String newDescription)

getPackage

java.lang.String getPackage()

setPackage

void setPackage(java.lang.String newPackage)

getAccess

AccessType getAccess()
Return the specified access if present, otherwise return the default access.

Specified by:
getAccess in interface MappingFileRoot

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.


getCatalog

java.lang.String getCatalog()
Return the specified catalog if present, otherwise return the default catalog.

Specified by:
getCatalog in interface MappingFileRoot

getSpecifiedCatalog

java.lang.String getSpecifiedCatalog()

setSpecifiedCatalog

void setSpecifiedCatalog(java.lang.String catalog)

getDefaultCatalog

java.lang.String getDefaultCatalog()

getDbCatalog

Catalog getDbCatalog()

getSchema

java.lang.String getSchema()
Return the specified schema if present, otherwise return the default schema.

Specified by:
getSchema in interface MappingFileRoot

getSpecifiedSchema

java.lang.String getSpecifiedSchema()

setSpecifiedSchema

void setSpecifiedSchema(java.lang.String schema)

getDefaultSchema

java.lang.String getDefaultSchema()

getDbSchema

Schema getDbSchema()

getPersistenceUnitMetadata

PersistenceUnitMetadata getPersistenceUnitMetadata()

getPersistentTypes

org.eclipse.jpt.utility.internal.iterables.ListIterable<OrmPersistentType> getPersistentTypes()
Description copied from interface: PersistentTypeContainer
Return the container's persistent types.

Specified by:
getPersistentTypes 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 fullyQualifiedTypeName)

getPersistentType

OrmPersistentType getPersistentType(java.lang.String fullyQualifiedTypeName)
Return the {@link OrmPersistentType) listed in this mapping file with the given fully qualified type name. Return null if none exists.


getSequenceGenerators

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

getSequenceGeneratorsSize

int getSequenceGeneratorsSize()

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.utility.internal.iterables.ListIterable<OrmTableGenerator> getTableGenerators()

getTableGeneratorsSize

int getTableGeneratorsSize()

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

getPersistenceUnitDefaults

OrmPersistenceUnitDefaults getPersistenceUnitDefaults()
Description copied from interface: MappingFileRoot
Return the defaults defined within this mapping file *for the persistence unit*. Return null if none exists.

Specified by:
getPersistenceUnitDefaults in interface MappingFileRoot
See Also:
MappingFilePersistenceUnitDefaults.resourceExists()

getDefaultPersistentTypePackage

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


isDefaultPersistentTypeMetadataComplete

boolean isDefaultPersistentTypeMetadataComplete()
Return the default metadata complete value 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 JavaResourcePersistentType for the given class name found in the JPA project. First look for one with this exact class name (since it might be fully qualified) and then prepend the default package name and attempt to resolve.

See Also:
getPackage()

resolvePersistentType

PersistentType resolvePersistentType(java.lang.String className)
Return the PersistentType for the given class name found in the persistence unit. First look for one with this exact class name (since it might be fully qualified) and then prepend the default package name and attempt to resolve.

See Also:
getPackage()

update

void update()
Update the EntityMappings context model object to match the XmlEntityMappings resource model object. see JpaProject.update()