Dali Provisional API
Release 3.2

org.eclipse.jpt.jpa.core.context
Interface TypeMapping

All Superinterfaces:
IAdaptable, JpaContextModel, JpaModel, JptResourceTypeReference, Model
All Known Subinterfaces:
EclipseLinkEmbeddable, EclipseLinkEntity, EclipseLinkJavaEmbeddable, EclipseLinkJavaEntity, EclipseLinkJavaMappedSuperclass, EclipseLinkJavaNonEmbeddableTypeMapping, EclipseLinkJavaTypeMapping, EclipseLinkMappedSuperclass, EclipseLinkNonEmbeddableTypeMapping, EclipseLinkOrmEmbeddable, EclipseLinkOrmEntity, EclipseLinkOrmMappedSuperclass, EclipseLinkOrmNonEmbeddableTypeMapping, EclipseLinkOrmTypeMapping, EclipseLinkTypeMapping, Embeddable, Entity, IdTypeMapping, JavaEmbeddable, JavaEntity, JavaEntity2_0, JavaIdTypeMapping, JavaMappedSuperclass, JavaTypeMapping, MappedSuperclass, OrmEmbeddable, OrmEntity, OrmEntity2_0, OrmIdTypeMapping, OrmMappedSuperclass, OrmTypeMapping

public interface TypeMapping
extends JpaContextModel

type mapping:

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
static class TypeMapping.GeneratorsTransformer
           
static class TypeMapping.QueriesTransformer
           
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaModel
JpaModel.JpaVersionIsCompatibleWith
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeIsKindOf, JptResourceTypeReference.ResourceTypeTransformer
 
Field Summary
static org.eclipse.jpt.common.utility.transformer.Transformer<TypeMapping,Iterable<Generator>> GENERATORS_TRANSFORMER
           
static org.eclipse.jpt.common.utility.transformer.Transformer<TypeMapping,Iterable<Query>> QUERIES_TRANSFORMER
           
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
TRANSFORMER
 
Method Summary
 boolean attributeIsDerivedId(String attributeName)
          Return whether the attribute with the specified name is a derived ID.
 boolean attributeMappingKeyAllowed(String attributeMappingKey)
          Return whether the given attribute mapping key is valid for this particular type mapping (for example, id's are not valid for an embeddable type mapping)
 Iterable<String> getAllAssociatedTableNames()
          Return the names of the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables, as well as all the inherited "associated" tables.
 Iterable<Table> getAllAssociatedTables()
          Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables, as well as all inherited "associated" tables.
 Iterable<AttributeMapping> getAllAttributeMappings()
          Return all the attribute mappings in the type mapping's inheritance hierarchy.
<T extends AttributeMapping>
Iterable<T>
getAllAttributeMappings(String mappingKey)
          Return attribute mappings of a particular mapping type that are declared anywhere on this type mapping's hierarchy
 Iterable<String> getAllOverridableAssociationNames()
          Return an Iterator of all associations names that can be overridden in this type mapping.
 Iterable<String> getAllOverridableAttributeNames()
          Return an Iterator of all attribute names that can be overridden in this type mapping.
 Iterable<Table> getAssociatedTables()
          Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables.
<T extends AttributeMapping>
Iterable<T>
getAttributeMappings()
          A convenience method for getting the attribute mappings from PersistentType.attributes()
<T extends AttributeMapping>
Iterable<T>
getAttributeMappings(String mappingKey)
          Return attribute mappings of a particular mapping type that are declared on this type mapping
 Schema getDbSchema()
           
 Iterable<Generator> getGenerators()
           
 JavaPersistentType getIdClass()
          Return the resolved id class specified on this type mapping, null otherwise
 Iterable<TypeMapping> getInheritanceHierarchy()
          Return the type mapping's "persistence" inheritance hierarchy, including the type mapping itself.
 InheritanceType getInheritanceStrategy()
          Return the inheritance strategy or null
 JavaResourceType getJavaResourceType()
          Return the corresponding java resource type, this can be null
 String getKey()
          Return a unique key for the type mapping.
 String getName()
          Return the name, specified or default if not specified.
 Iterable<AttributeMapping> getNonTransientAttributeMappings()
          Return all the non-transient attribute mappings in the type mapping's inheritance hierarchy
 Iterable<String> getOverridableAssociationNames()
          Return an Iterator of associations names that can be overridden in this type mapping.
 Iterable<String> getOverridableAttributeNames()
          Return an Iterator of attribute names that can be overridden by a sub type mapping.
 PersistentType getPersistentType()
           
 Table getPrimaryDbTable()
          Return the type mapping's primary database table.
 String getPrimaryTableName()
          Return the type mapping's primary table name.
 Iterable<Query> getQueries()
           
 Entity getRootEntity()
          Return the root entity of the inheritance hierarchy or null.
 TypeMapping getSuperTypeMapping()
          Return the type mapping of this type mapping's super type.
 boolean isMapped()
           
 boolean isRootEntity()
          Return whether this type mapping is a root entity in an inheritance hierarchy.
 Table resolveDbTable(String tableName)
          Return the resolved associated db table with the specified name; i.e. the specified table must be among those associated with the type mapping otherwise return null.
 SpecifiedColumn resolveOverriddenColumn(String attributeName)
          Return the column of the overridable attribute mapping (or attribute override) with the specified attribute name.
 SpecifiedRelationship resolveOverriddenRelationship(String attributeName)
           
 boolean tableNameIsInvalid(String tableName)
          Return whether the specified table is invalid for any annotations associated with the type mapping.
 boolean validatesAgainstDatabase()
          Return whether any database metadata specific validation should occur.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextModel
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getParent, getPersistenceUnit, getValidationTextRange, synchronizeWithResourceModel, update, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaModel
getJpaPlatform, getJpaProject, getJpaProjectManager, getResource, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
getResourceType
 

Field Detail

QUERIES_TRANSFORMER

static final org.eclipse.jpt.common.utility.transformer.Transformer<TypeMapping,Iterable<Query>> QUERIES_TRANSFORMER

GENERATORS_TRANSFORMER

static final org.eclipse.jpt.common.utility.transformer.Transformer<TypeMapping,Iterable<Generator>> GENERATORS_TRANSFORMER
Method Detail

getPersistentType

PersistentType getPersistentType()

getJavaResourceType

JavaResourceType getJavaResourceType()
Return the corresponding java resource type, this can be null


getKey

String getKey()
Return a unique key for the type mapping. If this is defined in an extension they should be equal.


getName

String getName()
Return the name, specified or default if not specified.


isMapped

boolean isMapped()

getIdClass

JavaPersistentType getIdClass()
Return the resolved id class specified on this type mapping, null otherwise


getQueries

Iterable<Query> getQueries()

getGenerators

Iterable<Generator> getGenerators()

getSuperTypeMapping

TypeMapping getSuperTypeMapping()
Return the type mapping of this type mapping's super type. Return null if this is the root.


getInheritanceHierarchy

Iterable<TypeMapping> getInheritanceHierarchy()
Return the type mapping's "persistence" inheritance hierarchy, including the type mapping itself. The returned iterator will return elements infinitely if the hierarchy has a loop.


getInheritanceStrategy

InheritanceType getInheritanceStrategy()
Return the inheritance strategy or null


isRootEntity

boolean isRootEntity()
Return whether this type mapping is a root entity in an inheritance hierarchy.


getRootEntity

Entity getRootEntity()
Return the root entity of the inheritance hierarchy or null.


getPrimaryTableName

String getPrimaryTableName()
Return the type mapping's primary table name. Return null if a primary table is not applicable.


getPrimaryDbTable

Table getPrimaryDbTable()
Return the type mapping's primary database table. Return null if a primary table is not applicable.


getDbSchema

Schema getDbSchema()

getAssociatedTables

Iterable<Table> getAssociatedTables()
Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables.


getAllAssociatedTables

Iterable<Table> getAllAssociatedTables()
Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables, as well as all inherited "associated" tables.


getAllAssociatedTableNames

Iterable<String> getAllAssociatedTableNames()
Return the names of the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables, as well as all the inherited "associated" tables.


resolveDbTable

Table resolveDbTable(String tableName)
Return the resolved associated db table with the specified name; i.e. the specified table must be among those associated with the type mapping otherwise return null.

NB: The spec does allow for columns or join columns to specify a schema and/or catalog; so the results can be unpredictable....


tableNameIsInvalid

boolean tableNameIsInvalid(String tableName)
Return whether the specified table is invalid for any annotations associated with the type mapping. The table name is case- sensitive when the database connection is missing or inactive; when the database connection is active, case-sensitivity is determined by the database.


getAttributeMappings

<T extends AttributeMapping> Iterable<T> getAttributeMappings()
A convenience method for getting the attribute mappings from PersistentType.attributes()


getAttributeMappings

<T extends AttributeMapping> Iterable<T> getAttributeMappings(String mappingKey)
Return attribute mappings of a particular mapping type that are declared on this type mapping


getAllAttributeMappings

Iterable<AttributeMapping> getAllAttributeMappings()
Return all the attribute mappings in the type mapping's inheritance hierarchy.


getNonTransientAttributeMappings

Iterable<AttributeMapping> getNonTransientAttributeMappings()
Return all the non-transient attribute mappings in the type mapping's inheritance hierarchy


getAllAttributeMappings

<T extends AttributeMapping> Iterable<T> getAllAttributeMappings(String mappingKey)
Return attribute mappings of a particular mapping type that are declared anywhere on this type mapping's hierarchy


attributeMappingKeyAllowed

boolean attributeMappingKeyAllowed(String attributeMappingKey)
Return whether the given attribute mapping key is valid for this particular type mapping (for example, id's are not valid for an embeddable type mapping)


attributeIsDerivedId

boolean attributeIsDerivedId(String attributeName)
Return whether the attribute with the specified name is a derived ID.


getOverridableAttributeNames

Iterable<String> getOverridableAttributeNames()
Return an Iterator of attribute names that can be overridden by a sub type mapping.


getAllOverridableAttributeNames

Iterable<String> getAllOverridableAttributeNames()
Return an Iterator of all attribute names that can be overridden in this type mapping.


resolveOverriddenColumn

SpecifiedColumn resolveOverriddenColumn(String attributeName)
Return the column of the overridable attribute mapping (or attribute override) with the specified attribute name.

In JPA 2.0 this name can use dot-notation to designate nested attributes in embedded attribute mapping's embeddable type mapping.


getOverridableAssociationNames

Iterable<String> getOverridableAssociationNames()
Return an Iterator of associations names that can be overridden in this type mapping.


getAllOverridableAssociationNames

Iterable<String> getAllOverridableAssociationNames()
Return an Iterator of all associations names that can be overridden in this type mapping.


resolveOverriddenRelationship

SpecifiedRelationship resolveOverriddenRelationship(String attributeName)

validatesAgainstDatabase

boolean validatesAgainstDatabase()
Return whether any database metadata specific validation should occur. (For instance, if the connection is not active, then it should not.)


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.