org.eclipse.jpt.core.context
Interface TypeMapping

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

public interface TypeMapping
extends JpaContextNode

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<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<java.lang.String> associatedTableNamesIncludingInherited()
          Return the identifiers 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<Table> associatedTables()
          Return the type mapping's "associated" tables, which includes the primary table and the collection of secondary tables.
 java.util.Iterator<Table> associatedTablesIncludingInherited()
          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.
 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()
           
 Table getDbTable(java.lang.String tableName)
          return the resolved associated db table with the passed in name
 JavaPersistentType getIdClass()
          Return the resolved id class specified on this type mapping, null otherwise
 java.lang.String getKey()
          Return a unique key for the ITypeMapping.
 PersistentType getPersistentType()
           
 Table getPrimaryDbTable()
          Return the type mapping's primary database table.
 java.lang.String getPrimaryTableName()
          Return the type mapping's primary table name, null if a primary table does not apply.
 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.
 Column resolveOverriddenColumn(java.lang.String attributeName)
          Returns the Column of the overridable attribute mapping with the given attribute name.
 RelationshipReference resolveRelationshipReference(java.lang.String associationOverrideName)
           
 boolean shouldValidateAgainstDatabase()
          Return whether any database metadata specific validation should occur.
 boolean tableNameIsInvalid(java.lang.String tableName)
          Return whether the specified table is invalid for any annotations associated with the type mapping.
 
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
 

Method Detail

getKey

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


getPersistentType

PersistentType getPersistentType()

isMapped

boolean isMapped()

getIdClass

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


getPrimaryTableName

java.lang.String getPrimaryTableName()
Return the type mapping's primary table name, null if a primary table does not apply.


getPrimaryDbTable

Table getPrimaryDbTable()
Return the type mapping's primary database table.


getDbSchema

Schema getDbSchema()

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.


associatedTables

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


associatedTablesIncludingInherited

java.util.Iterator<Table> associatedTablesIncludingInherited()
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.


associatedTableNamesIncludingInherited

java.util.Iterator<java.lang.String> associatedTableNamesIncludingInherited()
Return the identifiers 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.


getDbTable

Table getDbTable(java.lang.String tableName)
return the resolved associated db table with the passed in 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


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)
Returns the Column of the overridable attribute mapping with the given attribute name. In 2.0 this name could use dot-notation for nested mappings.


resolveRelationshipReference

RelationshipReference resolveRelationshipReference(java.lang.String associationOverrideName)

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.


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)


shouldValidateAgainstDatabase

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