org.eclipse.jpt.core.context
Interface AttributeMapping

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, Model
All Known Subinterfaces:
AttributeMapping2_0, BaseEmbeddedMapping, BasicMapping, CollectionMapping, CollectionMapping2_0, ColumnMapping, EclipseLinkBasicCollectionMapping, EclipseLinkBasicMapMapping, EclipseLinkBasicMapping, EclipseLinkElementCollectionMapping2_0, EclipseLinkIdMapping, EclipseLinkOneToManyMapping, EclipseLinkOneToManyMapping2_0, EclipseLinkOneToOneMapping, EclipseLinkOneToOneMapping2_0, EclipseLinkRelationshipMapping, EclipseLinkTransformationMapping, EclipseLinkVariableOneToOneMapping, EclipseLinkVersionMapping, ElementCollectionMapping2_0, EmbeddedIdMapping, EmbeddedIdMapping2_0, EmbeddedMapping, EmbeddedMapping2_0, Fetchable, IdMapping, IdMapping2_0, JavaAttributeMapping, JavaBaseEmbeddedMapping, JavaBasicMapping, JavaCollectionMapping2_0, JavaColumnMapping, JavaElementCollectionMapping2_0, JavaEmbeddedIdMapping, JavaEmbeddedMapping, JavaEmbeddedMapping2_0, JavaIdMapping, JavaManyToManyMapping, JavaManyToManyMapping2_0, JavaManyToOneMapping, JavaManyToOneMapping2_0, JavaMultiRelationshipMapping, JavaOneToManyMapping, JavaOneToManyMapping2_0, JavaOneToOneMapping, JavaOneToOneMapping2_0, JavaRelationshipMapping, JavaRelationshipMapping2_0, JavaSingleRelationshipMapping, JavaSingleRelationshipMapping2_0, JavaTransientMapping, JavaVersionMapping, ManyToManyMapping, ManyToManyMapping2_0, ManyToOneMapping, ManyToOneMapping2_0, MultiRelationshipMapping, Nullable, OneToManyMapping, OneToManyMapping2_0, OneToOneMapping, OneToOneMapping2_0, OrmAttributeMapping, OrmBaseEmbeddedMapping, OrmBasicMapping, OrmCollectionMapping2_0, OrmColumnMapping, OrmElementCollectionMapping2_0, OrmEmbeddedIdMapping, OrmEmbeddedMapping, OrmEmbeddedMapping2_0, OrmIdMapping, OrmManyToManyMapping, OrmManyToManyMapping2_0, OrmManyToOneMapping, OrmManyToOneMapping2_0, OrmMultiRelationshipMapping, OrmOneToManyMapping, OrmOneToManyMapping2_0, OrmOneToOneMapping, OrmOneToOneMapping2_0, OrmRelationshipMapping, OrmSingleRelationshipMapping, OrmSingleRelationshipMapping2_0, OrmTransientMapping, OrmVersionMapping, RelationshipMapping, SingleRelationshipMapping, SingleRelationshipMapping2_0, TransientMapping, VersionMapping

public interface AttributeMapping
extends JpaContextNode

JPA attribute 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> allMappingNames()
          This is used for mappedBy choices in a relationship mapping.
 java.util.Iterator<java.lang.String> allOverrideableAssociationMappingNames()
          This is used to determine the virtual association overrides for an embedded mapping or an entity.
 java.util.Iterator<java.lang.String> allOverrideableAttributeMappingNames()
          This is used to determine the virtual attribute overrides for an embedded mapping or an entity.
 java.lang.String getKey()
          Return a unique key for the attribute mapping.
 java.lang.String getName()
           
 PersistentAttribute getPersistentAttribute()
           
 java.lang.String getPrimaryKeyColumnName()
          If the mapping is for a primary key column, return the column's name, otherwise return null.
 TypeMapping getTypeMapping()
          Return the mapping for the attribute mapping's attribute's type.
 boolean isDefault()
           
 boolean isOverridableAssociationMapping()
          Return whether the "association" mapping can be overridden.
 boolean isOverridableAttributeMapping()
          Return whether the "attribute" mapping can be overridden.
 boolean isOwnedBy(AttributeMapping mapping)
          Return whether the given mapping manages a relationship with this mapping
 boolean isRelationshipOwner()
          Return whether this mapping is the owning side of the relationship.
 AttributeMapping resolveAttributeMapping(java.lang.String name)
          Returns this attribute mapping if its name matches the name.
 Column resolveOverriddenColumn(java.lang.String attributeName)
          Returns the Column of the overridable attribute mapping with the given attribute name.
 RelationshipReference resolveRelationshipReference(java.lang.String attributeName)
           
 boolean shouldValidateAgainstDatabase()
          Return whether any database metadata specific validation should occur.
 
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

getPersistentAttribute

PersistentAttribute getPersistentAttribute()

getName

java.lang.String getName()

isDefault

boolean isDefault()

getKey

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


isOverridableAttributeMapping

boolean isOverridableAttributeMapping()
Return whether the "attribute" mapping can be overridden. Must be a ColumnMapping


isOverridableAssociationMapping

boolean isOverridableAssociationMapping()
Return whether the "association" mapping can be overridden. Must be a RelationshipMapping


getTypeMapping

TypeMapping getTypeMapping()
Return the mapping for the attribute mapping's attribute's type.


getPrimaryKeyColumnName

java.lang.String getPrimaryKeyColumnName()
If the mapping is for a primary key column, return the column's name, otherwise return null.


isRelationshipOwner

boolean isRelationshipOwner()
Return whether this mapping is the owning side of the relationship. Either this is a unidirectional mapping or it is the owning side of a bidirectional relationship. If bidirectional, the owning side is the side that does not specify 'mappedBy'. The owning side is the side where the join table would be specified. If this returns true then the mapping will be a RelationshipMapping


isOwnedBy

boolean isOwnedBy(AttributeMapping mapping)
Return whether the given mapping manages a relationship with this 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.)


allMappingNames

java.util.Iterator<java.lang.String> allMappingNames()
This is used for mappedBy choices in a relationship mapping. Typically this will just be a single element iterator with the name of the mapping. In a 2.0 project, an embedded mapping should return its own name as well as the name of its target Embeddable's mappings with the embedded mapping name prepended : "embedded", "embedded.foo", "embedded.bar".


allOverrideableAttributeMappingNames

java.util.Iterator<java.lang.String> allOverrideableAttributeMappingNames()
This is used to determine the virtual attribute overrides for an embedded mapping or an entity. Return an Iterator of all attribute names that can be overridden. In a 2.0 project this will include nested attributes that are overridable

See Also:
isOverridableAttributeMapping()

allOverrideableAssociationMappingNames

java.util.Iterator<java.lang.String> allOverrideableAssociationMappingNames()
This is used to determine the virtual association overrides for an embedded mapping or an entity. Return an Iterator of all association names that can be overridden. In a 2.0 project this will include nested associations that are overridable

See Also:
isOverridableAssociationMapping()

resolveAttributeMapping

AttributeMapping resolveAttributeMapping(java.lang.String name)
Returns this attribute mapping if its name matches the name. In 2.0 this name could use dot-notation for nested mappings. 2.0 Embedded mappings will have to parse this name and return the appropriate nested attribute 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 attributeName)