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

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, Model
All Known Subinterfaces:
EclipseLinkEmbeddable, EclipseLinkEntity, EclipseLinkJavaTypeMapping, EclipseLinkMappedSuperclass, EclipseLinkNonEmbeddableTypeMapping, EclipseLinkOrmTypeMapping, EclipseLinkTypeMapping, Embeddable, Entity, JavaEclipseLinkEmbeddable, JavaEclipseLinkEntity, JavaEclipseLinkMappedSuperclass, JavaEclipseLinkNonEmbeddableTypeMapping, JavaEmbeddable, JavaEntity, JavaMappedSuperclass, JavaTypeMapping, MappedSuperclass, OrmEclipseLinkEmbeddable, OrmEclipseLinkEntity, OrmEclipseLinkMappedSuperclass, OrmEclipseLinkNonEmbeddableTypeMapping, OrmEmbeddable, OrmEntity, OrmMappedSuperclass, OrmTypeMapping

public interface TypeMapping
extends JpaContextNode

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
Version:
2.3

Method Summary
 java.util.Iterator<java.lang.String> allAssociatedTableNames()
          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.
 java.util.Iterator<ReadOnlyTable> allAssociatedTables()
          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.
 java.util.Iterator<AttributeMapping> allAttributeMappings()
          Return all the attribute mappings in the type mapping's inheritance hierarchy.
 java.util.Iterator<java.lang.String> allOverridableAssociationNames()
          Return an Iterator of all associations names that can be overridden in this type mapping.
 java.util.Iterator<java.lang.String> allOverridableAttributeNames()
          Return an Iterator of all attribute names that can be overridden in this type mapping.
 java.util.Iterator<ReadOnlyTable> associatedTables()
          Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables.
 boolean attributeMappingKeyAllowed(java.lang.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)
<T extends AttributeMapping>
java.util.Iterator<T>
attributeMappings()
          A convenience method for getting the attribute mappings from PersistentType.attributes()
<T extends AttributeMapping>
java.lang.Iterable<T>
getAllAttributeMappings(java.lang.String mappingKey)
          Return attribute mappings of a particular mapping type that are declared anywhere on this type mapping's hierarchy
<T extends AttributeMapping>
java.lang.Iterable<T>
getAttributeMappings(java.lang.String mappingKey)
          Return attribute mappings of a particular mapping type that are declared on this type mapping
 Schema getDbSchema()
           
 JavaPersistentType getIdClass()
          Return the resolved id class specified on this type mapping, null otherwise
 java.lang.String getKey()
          Return a unique key for the type mapping.
 java.lang.String getName()
          Return the name, specified or default if not specified.
 PersistentType getPersistentType()
           
 Table getPrimaryDbTable()
          Return the type mapping's primary database table.
 java.lang.String getPrimaryTableName()
          Return the type mapping's primary table name.
 TypeMapping getSuperTypeMapping()
          Return the type mapping of this type mapping's super type.
 java.util.Iterator<TypeMapping> inheritanceHierarchy()
          Return the type mapping's "persistence" inheritance hierarchy, including the type mapping itself.
 boolean isMapped()
           
 java.util.Iterator<java.lang.String> overridableAssociationNames()
          Return an Iterator of associations names that can be overridden in this type mapping.
 java.util.Iterator<java.lang.String> overridableAttributeNames()
          Return an Iterator of attribute names that can be overridden by a sub type mapping.
 Table resolveDbTable(java.lang.String tableName)
          Return the resolved associated db table with the specified name.
 Column resolveOverriddenColumn(java.lang.String attributeName)
          Return the column of the overridable attribute mapping (or attribute override) with the specified attribute name.
 Relationship resolveOverriddenRelationship(java.lang.String attributeName)
           
 boolean tableNameIsInvalid(java.lang.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.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, synchronizeWithResourceModel, update
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
getJpaProject, getParent, 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
 

Method Detail

getPersistentType

PersistentType getPersistentType()

getKey

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


getName

java.lang.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


getSuperTypeMapping

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


inheritanceHierarchy

java.util.Iterator<TypeMapping> inheritanceHierarchy()
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.


getPrimaryTableName

java.lang.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()

associatedTables

java.util.Iterator<ReadOnlyTable> associatedTables()
Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables.


allAssociatedTables

java.util.Iterator<ReadOnlyTable> allAssociatedTables()
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.


allAssociatedTableNames

java.util.Iterator<java.lang.String> allAssociatedTableNames()
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(java.lang.String tableName)
Return the resolved associated db table with the specified name.


tableNameIsInvalid

boolean tableNameIsInvalid(java.lang.String tableName)
Return whether the specified table is invalid for any annotations associated with the type mapping.


attributeMappings

<T extends AttributeMapping> java.util.Iterator<T> attributeMappings()
A convenience method for getting the attribute mappings from PersistentType.attributes()


getAttributeMappings

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


allAttributeMappings

java.util.Iterator<AttributeMapping> allAttributeMappings()
Return all the attribute mappings in the type mapping's inheritance hierarchy.


getAllAttributeMappings

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


attributeMappingKeyAllowed

boolean attributeMappingKeyAllowed(java.lang.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)


overridableAttributeNames

java.util.Iterator<java.lang.String> overridableAttributeNames()
Return an Iterator of attribute names that can be overridden by a sub type mapping.


allOverridableAttributeNames

java.util.Iterator<java.lang.String> allOverridableAttributeNames()
Return an Iterator of all attribute names that can be overridden in this type mapping.


resolveOverriddenColumn

Column resolveOverriddenColumn(java.lang.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.


overridableAssociationNames

java.util.Iterator<java.lang.String> overridableAssociationNames()
Return an Iterator of associations names that can be overridden in this type mapping.


allOverridableAssociationNames

java.util.Iterator<java.lang.String> allOverridableAssociationNames()
Return an Iterator of all associations names that can be overridden in this type mapping.


resolveOverriddenRelationship

Relationship resolveOverriddenRelationship(java.lang.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.)