org.eclipse.jpt.jpa.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, ConvertibleMapping, EclipseLinkBasicCollectionMapping, EclipseLinkBasicMapMapping, EclipseLinkBasicMapping, EclipseLinkElementCollectionMapping2_0, EclipseLinkIdMapping, EclipseLinkJoinFetchMapping, EclipseLinkOneToManyMapping, EclipseLinkOneToManyMapping2_0, EclipseLinkOneToOneMapping, EclipseLinkOneToOneMapping2_0, EclipseLinkRelationshipMapping, EclipseLinkTransformationMapping, EclipseLinkVariableOneToOneMapping, EclipseLinkVersionMapping, ElementCollectionMapping2_0, EmbeddedIdMapping, EmbeddedIdMapping2_0, EmbeddedMapping, EmbeddedMapping2_0, FetchableMapping, IdMapping, IdMapping2_0, JavaAttributeMapping, JavaBaseEmbeddedMapping, JavaBasicMapping, JavaCollectionMapping, JavaCollectionMapping2_0, JavaColumnMapping, JavaConvertibleMapping, JavaElementCollectionMapping2_0, JavaEmbeddedIdMapping, JavaEmbeddedMapping, JavaEmbeddedMapping2_0, JavaIdMapping, JavaManyToManyMapping, JavaManyToManyMapping2_0, JavaManyToOneMapping, JavaManyToOneMapping2_0, JavaMultiRelationshipMapping, JavaOneToManyMapping, JavaOneToManyMapping2_0, JavaOneToOneMapping, JavaOneToOneMapping2_0, JavaRelationshipMapping, JavaSingleRelationshipMapping, JavaSingleRelationshipMapping2_0, JavaTransientMapping, JavaVersionMapping, ManyToManyMapping, ManyToManyMapping2_0, ManyToOneMapping, ManyToOneMapping2_0, MappedByRelationshipMapping2_0, MultiRelationshipMapping, OneToManyMapping, OneToManyMapping2_0, OneToOneMapping, OneToOneMapping2_0, OptionalMapping, OrmAttributeMapping, OrmBaseEmbeddedMapping, OrmBasicMapping, OrmCollectionMapping, OrmCollectionMapping2_0, OrmColumnMapping, OrmConvertibleMapping, 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

Field Summary
static java.lang.String DEFAULT_PROPERTY
           
 
Method Summary
 java.util.Iterator<java.lang.String> allMappingNames()
          This is used for "mapped by" choices in a relationship mapping.
 java.util.Iterator<java.lang.String> allOverridableAssociationMappingNames()
          This is used to determine the virtual association overrides for an embedded mapping or entity.
 java.util.Iterator<java.lang.String> allOverridableAttributeMappingNames()
          This is used to determine the virtual attribute overrides for an embedded mapping or entity.
 java.lang.String getKey()
          Return a unique key for the attribute mapping.
 java.lang.String getName()
          Return the mapping's name, which corresponds to the name of the associated attribute.
 PersistentAttribute getPersistentAttribute()
          Return the mapping's attribute (typically its parent node in the containment hierarchy).
 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 type that contains the mapping's attribute.
 boolean isDefault()
          Return whether the mapping is its attribute's default mapping (as opposed to its specified mapping).
 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 specified mapping manages a relationship with the mapping.
 boolean isRelationshipOwner()
          Return whether this mapping is the owning side of a relationship.
 AttributeMapping resolveAttributeMapping(java.lang.String name)
          Return the mapping itself if its name matches 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)
          Return the relationship for the specified attribute.
 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
 

Field Detail

DEFAULT_PROPERTY

static final java.lang.String DEFAULT_PROPERTY
See Also:
Constant Field Values
Method Detail

getPersistentAttribute

PersistentAttribute getPersistentAttribute()
Return the mapping's attribute (typically its parent node in the containment hierarchy).


getName

java.lang.String getName()
Return the mapping's name, which corresponds to the name of the associated attribute.


isDefault

boolean isDefault()
Return whether the mapping is its attribute's default mapping (as opposed to its specified mapping).


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. The mapping must be a ColumnMapping.


isOverridableAssociationMapping

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


getTypeMapping

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


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 a 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 a "mapped by" attribute name. The owning side is the side where the join table is to be specified. If this returns true the mapping will be a RelationshipMapping.


isOwnedBy

boolean isOwnedBy(AttributeMapping mapping)
Return whether the specified mapping manages a relationship with the mapping.


validatesAgainstDatabase

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


resolveOverriddenRelationship

Relationship resolveOverriddenRelationship(java.lang.String attributeName)
Return the relationship for the specified attribute.


allMappingNames

java.util.Iterator<java.lang.String> allMappingNames()
This is used for "mapped by" choices in a relationship mapping. Typically this will just be a single element iterator with the mapping's name.

In a JPA 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, e.g.:


allOverridableAttributeMappingNames

java.util.Iterator<java.lang.String> allOverridableAttributeMappingNames()
This is used to determine the virtual attribute overrides for an embedded mapping or entity. Return the names of all the attributes that can be overridden.

In a JPA 2.0 project this will include overridable nested attributes.

See Also:
isOverridableAttributeMapping()

allOverridableAssociationMappingNames

java.util.Iterator<java.lang.String> allOverridableAssociationMappingNames()
This is used to determine the virtual association overrides for an embedded mapping or entity. Return the names of all the associations that can be overridden.

In a JPA 2.0 project this will include overridable nested associations.

See Also:
isOverridableAssociationMapping()

resolveAttributeMapping

AttributeMapping resolveAttributeMapping(java.lang.String name)
Return the mapping itself if its name matches the specified name.

In JPA 2.0 this name could use dot-notation for nested mappings. JPA 2.0 embedded mappings will have to parse this name and return the appropriate nested 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.