Dali Provisional API
Release 3.2

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

All Superinterfaces:
AccessReference, DeleteTypeRefactoringParticipant, IAdaptable, JpaContextModel, JpaModel, JpaStructureNode, JptResourceTypeReference, ManagedTypeContainer, MappingFile.Root, Model, PersistentType.Parent, PersistentTypeContainer, SpecifiedAccessReference, TypeRefactoringParticipant, XmlFile.Root
All Known Subinterfaces:
EclipseLinkEntityMappings

public interface EntityMappings
extends MappingFile.Root, XmlFile.Root, PersistentType.Parent, SpecifiedAccessReference, DeleteTypeRefactoringParticipant, TypeRefactoringParticipant

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.PersistentTypeContainer
PersistentTypeContainer.PersistentTypesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.ManagedTypeContainer
ManagedTypeContainer.ContainsType, ManagedTypeContainer.ManagedTypesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
JpaStructureNode.ContextType
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
DeleteTypeRefactoringParticipant.DeleteTypeEditsTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
TypeRefactoringParticipant.MoveTypeEditsTransformer, TypeRefactoringParticipant.RenamePackageEditsTransformer, TypeRefactoringParticipant.RenameTypeEditsTransformer
 
Field Summary
static String DEFAULT_CATALOG_PROPERTY
           
static String DEFAULT_SCHEMA_PROPERTY
           
static String DESCRIPTION_PROPERTY
           
static String MANAGED_TYPES_LIST
           
static String PACKAGE_PROPERTY
           
static String SEQUENCE_GENERATORS_LIST
           
static String SPECIFIED_CATALOG_PROPERTY
           
static String SPECIFIED_SCHEMA_PROPERTY
           
static String TABLE_GENERATORS_LIST
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.PersistentTypeContainer
TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
STRUCTURE_CHILDREN_COLLECTION
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference
DEFAULT_ACCESS_PROPERTY, SPECIFIED_ACCESS_PROPERTY
 
Method Summary
 OrmPersistentType addPersistentType(String mappingKey, String className)
           
 void addPersistentTypes(PersistentType.Config[] typeConfigs, IProgressMonitor monitor)
          Add types to the entity mappings with the specified names and corresponding mapping types.
 OrmSequenceGenerator addSequenceGenerator()
           
 OrmSequenceGenerator addSequenceGenerator(int index)
           
 OrmTableGenerator addTableGenerator()
           
 OrmTableGenerator addTableGenerator(int index)
           
 void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping)
           
 boolean containsManagedType(String typeName)
           
 void dispose()
           
 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.
 String getDefaultCatalog()
           
 String getDefaultPersistentTypePackage()
          Return the default package to be used for persistent types in this context.
 String getDefaultSchema()
           
 String getDescription()
           
 OrmManagedType getManagedType(String typeName)
          Return the managed type with the specified name.
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmManagedType> getManagedTypes()
          Covariant override.
 int getManagedTypesSize()
           
 Iterable<Generator> getMappingFileGenerators()
          Return all the generators defined in both the entity mappings and its type mappings (but not in any associated Java annotations).
 Iterable<Query> getMappingFileQueries()
          Return all the queries defined in both the entity mappings and its entities (but not in any associated Java annotations).
 OrmXml getOrmXml()
           
 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(String className)
          Return the persistent type with the specified name.
 Iterable<OrmPersistentType> getPersistentTypes()
          Covariant override.
 OrmQueryContainer getQueryContainer()
           
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmSequenceGenerator> getSequenceGenerators()
           
 int getSequenceGeneratorsSize()
           
 String getSpecifiedCatalog()
           
 String getSpecifiedSchema()
           
 Class<EntityMappings> getStructureType()
          Return the structure node's type.
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmTableGenerator> getTableGenerators()
           
 int getTableGeneratorsSize()
           
 String getVersion()
           
 org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings getXmlEntityMappings()
           
 void moveSequenceGenerator(int targetIndex, int sourceIndex)
           
 void moveTableGenerator(int targetIndex, int sourceIndex)
           
 String qualify(String className)
          If the specified class name is not qualified (i.e. it does not contain a '.'
 void removeManagedType(int index)
           
 void removeManagedType(OrmManagedType managedType)
           
 void removeSequenceGenerator(int index)
           
 void removeSequenceGenerator(OrmSequenceGenerator sequenceGenerator)
           
 void removeTableGenerator(int index)
           
 void removeTableGenerator(OrmTableGenerator tableGenerator)
           
 JavaResourceAbstractType resolveJavaResourceType(String className)
          Return the Java resource type for the specified class name found in the JPA project.
 JavaResourceAbstractType resolveJavaResourceType(String className, JavaResourceAnnotatedElement.AstNodeType astNodeType)
          Return the Java resource type for the specified class name and astNodeType found in the JPA project.
 IType resolveJdtType(String className)
          Return the JDT type for the specified class name found in the Java project.
 PersistentType resolvePersistentType(String className)
          Return the persistent type for the specified class name found in the persistence unit.
 void setDescription(String description)
           
 void setPackage(String package_)
           
 void setSpecifiedCatalog(String catalog)
           
 void setSpecifiedSchema(String schema)
           
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.MappingFile.Root
getAccess, getCatalog, getSchema
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
addRootStructureNodesTo, containsOffset, getContextType, getFullTextRange, getSelectionTextRange, getStructureChildren, getStructureChildrenSize, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.PersistentType.Parent
getDefaultPersistentTypeAccess, getOverridePersistentTypeAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference
getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessReference
getAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
createDeleteTypeEdits
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
createMoveTypeEdits, createRenamePackageEdits, createRenameTypeEdits
 

Field Detail

DESCRIPTION_PROPERTY

static final String DESCRIPTION_PROPERTY
See Also:
Constant Field Values

PACKAGE_PROPERTY

static final String PACKAGE_PROPERTY
See Also:
Constant Field Values

SPECIFIED_CATALOG_PROPERTY

static final String SPECIFIED_CATALOG_PROPERTY
See Also:
Constant Field Values

DEFAULT_CATALOG_PROPERTY

static final String DEFAULT_CATALOG_PROPERTY
See Also:
Constant Field Values

SPECIFIED_SCHEMA_PROPERTY

static final String SPECIFIED_SCHEMA_PROPERTY
See Also:
Constant Field Values

DEFAULT_SCHEMA_PROPERTY

static final String DEFAULT_SCHEMA_PROPERTY
See Also:
Constant Field Values

MANAGED_TYPES_LIST

static final String MANAGED_TYPES_LIST
See Also:
Constant Field Values

SEQUENCE_GENERATORS_LIST

static final String SEQUENCE_GENERATORS_LIST
See Also:
Constant Field Values

TABLE_GENERATORS_LIST

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

getParent

OrmXml getParent()
Description copied from interface: MappingFile.Root
covariant override

Specified by:
getParent in interface JpaContextModel
Specified by:
getParent in interface JpaModel
Specified by:
getParent in interface MappingFile.Root

getStructureType

Class<EntityMappings> getStructureType()
Description copied from interface: JpaStructureNode
Return the structure node's type. This is used to find the appropriate UI provider for building the structure node's JPA Details page.

Specified by:
getStructureType in interface JpaStructureNode

getOrmXml

OrmXml getOrmXml()

getXmlEntityMappings

org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings getXmlEntityMappings()

getVersion

String getVersion()

getDescription

String getDescription()

setDescription

void setDescription(String description)

getPackage

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."

Partial packages are not supported. The package element should only be used if a class is not qualified (i.e. it does not have a '.')

NB: No mention of how to resolve duplicates in the "default" package:

when package is specified as foo and class is specified as Bar.


setPackage

void setPackage(String package_)

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

String getSpecifiedCatalog()

setSpecifiedCatalog

void setSpecifiedCatalog(String catalog)

getDefaultCatalog

String getDefaultCatalog()

getDbCatalog

Catalog getDbCatalog()

getSpecifiedSchema

String getSpecifiedSchema()

setSpecifiedSchema

void setSpecifiedSchema(String schema)

getDefaultSchema

String getDefaultSchema()

getDbSchema

Schema getDbSchema()

getPersistenceUnitMetadata

OrmPersistenceUnitMetadata getPersistenceUnitMetadata()
Covariant override.

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

getManagedTypes

org.eclipse.jpt.common.utility.iterable.ListIterable<OrmManagedType> getManagedTypes()
Covariant override.

Specified by:
getManagedTypes in interface ManagedTypeContainer

getManagedTypesSize

int getManagedTypesSize()

getManagedType

OrmManagedType getManagedType(String typeName)
Description copied from interface: ManagedTypeContainer
Return the managed type with the specified name. Return null if the managed type is not found. If the persistent unit has more than one managed type with the specified name, return the first one found, using the following search order:

Specified by:
getManagedType in interface ManagedTypeContainer

removeManagedType

void removeManagedType(int index)

removeManagedType

void removeManagedType(OrmManagedType managedType)

containsManagedType

boolean containsManagedType(String typeName)

getPersistentTypes

Iterable<OrmPersistentType> getPersistentTypes()
Covariant override.

Specified by:
getPersistentTypes in interface PersistentTypeContainer

getPersistentType

OrmPersistentType getPersistentType(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

addPersistentType

OrmPersistentType addPersistentType(String mappingKey,
                                    String className)

getSequenceGenerators

org.eclipse.jpt.common.utility.iterable.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.iterable.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()

getMappingFileQueries

Iterable<Query> getMappingFileQueries()
Return all the queries defined in both the entity mappings and its entities (but not in any associated Java annotations).


getMappingFileGenerators

Iterable<Generator> getMappingFileGenerators()
Return all the generators defined in both the entity mappings and its type mappings (but not in any associated Java annotations).


getDefaultPersistentTypePackage

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


changeMapping

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

resolveJavaResourceType

JavaResourceAbstractType resolveJavaResourceType(String className)
Return the Java resource type for the specified class name found in the JPA project. Prepend the default package name if the class name is not fully qualified (i.e. it does not contain a '.').

See Also:
getPackage()

resolveJavaResourceType

JavaResourceAbstractType resolveJavaResourceType(String className,
                                                 JavaResourceAnnotatedElement.AstNodeType astNodeType)
Return the Java resource type for the specified class name and astNodeType found in the JPA project. Prepend the default package name if the class name is not fully qualified (i.e. it does not contain a '.'). Return null if invalid or absent or if the astNodeType does not match.

See Also:
getPackage()

resolvePersistentType

PersistentType resolvePersistentType(String className)
Return the persistent type for the specified class name found in the persistence unit. Prepend the default package name if the class name is not fully qualified (i.e. it does not contain a '.').

See Also:
getPackage()

resolveJdtType

IType resolveJdtType(String className)
Return the JDT type for the specified class name found in the Java project. Prepend the default package name if the class name is not fully qualified (i.e. it does not contain a '.').

See Also:
getPackage()

qualify

String qualify(String className)
If the specified class name is not qualified (i.e. it does not contain a '.'), prepend the default package name. Member classes must be qualified with a '$' for this to work correctly.

See Also:
getPackage()

addPersistentTypes

void addPersistentTypes(PersistentType.Config[] typeConfigs,
                        IProgressMonitor monitor)
Add types to the entity mappings with the specified names and corresponding mapping types.


dispose

void dispose()

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.