Dali Provisional API
Release 3.2

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

All Superinterfaces:
IAdaptable, JpaContextNode, JpaNode, JptResourceTypeReference, Model
All Known Subinterfaces:
AttributeMapping2_0, BaseEmbeddedMapping, BasicMapping, CollectionMapping, CollectionMapping2_0, ColumnMapping, ConvertibleKeyMapping2_0, ConvertibleMapping, DerivableIdMapping2_0, EclipseLinkArrayMapping2_3, EclipseLinkBasicCollectionMapping, EclipseLinkBasicMapMapping, EclipseLinkBasicMapping, EclipseLinkElementCollectionMapping2_0, EclipseLinkIdMapping, EclipseLinkIdMapping2_0, EclipseLinkJoinFetchMapping, EclipseLinkManyToManyMapping, EclipseLinkManyToManyMapping2_0, EclipseLinkManyToOneMapping, EclipseLinkManyToOneMapping2_0, EclipseLinkOneToManyMapping, EclipseLinkOneToManyMapping2_0, EclipseLinkOneToOneMapping, EclipseLinkOneToOneMapping2_0, EclipseLinkRelationshipMapping, EclipseLinkStructureMapping2_3, EclipseLinkTransformationMapping, EclipseLinkVariableOneToOneMapping, EclipseLinkVersionMapping, ElementCollectionMapping2_0, EmbeddedIdMapping, EmbeddedIdMapping2_0, EmbeddedMapping, EmbeddedMapping2_0, FetchableMapping, IdMapping, IdMapping2_0, JavaAttributeMapping, JavaBaseEmbeddedMapping, JavaBasicMapping, JavaCollectionMapping2_0, JavaColumnMapping, JavaConvertibleKeyMapping2_0, JavaConvertibleMapping, JavaElementCollectionMapping2_0, JavaEmbeddedIdMapping, JavaEmbeddedMapping, JavaEmbeddedMapping2_0, JavaGeneratedValueHolder, JavaIdMapping, JavaManyToManyMapping, JavaManyToOneMapping, JavaOneToManyMapping, JavaOneToOneMapping, JavaRelationshipMapping, JavaSingleRelationshipMapping, JavaSingleRelationshipMapping2_0, JavaTransientMapping, JavaVersionMapping, ManyToManyMapping, ManyToManyMapping2_0, ManyToOneMapping, ManyToOneMapping2_0, MultiRelationshipMapping, MultiRelationshipMapping2_0, OneToManyMapping, OneToManyMapping2_0, OneToOneMapping, OneToOneMapping2_0, OptionalMapping, OrmAttributeMapping, OrmBaseEmbeddedMapping, OrmBasicMapping, OrmCollectionMapping2_0, OrmColumnMapping, OrmConvertibleKeyMapping2_0, OrmConvertibleMapping, OrmElementCollectionMapping2_0, OrmEmbeddedIdMapping, OrmEmbeddedMapping, OrmEmbeddedMapping2_0, OrmIdMapping, OrmManyToManyMapping, OrmManyToOneMapping, OrmMultiRelationshipMapping, OrmOneToManyMapping, OrmOneToOneMapping, OrmRelationshipMapping, OrmSingleRelationshipMapping, OrmSingleRelationshipMapping2_0, OrmTransientMapping, OrmVersionMapping, RelationshipMapping, RelationshipMapping2_0, 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

Nested Class Summary
static class AttributeMapping.GeneratorsTransformer
           
static class AttributeMapping.IsNotTransient
           
static class AttributeMapping.IsOverridableAssociationMapping
           
static class AttributeMapping.KeyEquals
           
static class AttributeMapping.NameTransformer
           
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeTransformer
 
Field Summary
static String DEFAULT_PROPERTY
           
static org.eclipse.jpt.common.utility.transformer.Transformer<AttributeMapping,Iterable<Generator>> GENERATORS_TRANSFORMER
           
static org.eclipse.jpt.common.utility.predicate.Predicate<AttributeMapping> IS_NOT_TRANSIENT
           
static org.eclipse.jpt.common.utility.predicate.Predicate<AttributeMapping> IS_OVERRIDABLE_ASSOCIATION_MAPPING
           
static org.eclipse.jpt.common.utility.transformer.Transformer<AttributeMapping,String> NAME_TRANSFORMER
           
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
RESOURCE_TYPE_TRANSFORMER
 
Method Summary
 Iterable<String> getAllMappingNames()
          This is used for "mapped by" choices in a relationship mapping.
 Iterable<String> getAllOverridableAssociationMappingNames()
          This is used to determine the virtual association overrides for an embedded mapping or entity.
 Iterable<String> getAllOverridableAttributeMappingNames()
          This is used to determine the virtual attribute overrides for an embedded mapping or entity.
 Iterable<Generator> getGenerators()
          Typically only ID mappings have generators.
 String getKey()
          Return a unique key for the attribute mapping.
 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).
 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(String name)
          Return the mapping itself if its name matches the specified name.
 Column resolveOverriddenColumn(String attributeName)
          Return the column of the overridable attribute mapping (or attribute override) with the specified attribute name.
 Relationship resolveOverriddenRelationship(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
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getParent, getPersistenceUnit, getValidationTextRange, synchronizeWithResourceModel, update, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
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

NAME_TRANSFORMER

static final org.eclipse.jpt.common.utility.transformer.Transformer<AttributeMapping,String> NAME_TRANSFORMER

DEFAULT_PROPERTY

static final String DEFAULT_PROPERTY
See Also:
Constant Field Values

IS_NOT_TRANSIENT

static final org.eclipse.jpt.common.utility.predicate.Predicate<AttributeMapping> IS_NOT_TRANSIENT

IS_OVERRIDABLE_ASSOCIATION_MAPPING

static final org.eclipse.jpt.common.utility.predicate.Predicate<AttributeMapping> IS_OVERRIDABLE_ASSOCIATION_MAPPING

GENERATORS_TRANSFORMER

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

getPersistentAttribute

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


getName

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

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

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(String attributeName)
Return the relationship for the specified attribute.


getGenerators

Iterable<Generator> getGenerators()
Typically only ID mappings have generators.


getAllMappingNames

Iterable<String> getAllMappingNames()
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.:


getAllOverridableAttributeMappingNames

Iterable<String> getAllOverridableAttributeMappingNames()
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()

getAllOverridableAssociationMappingNames

Iterable<String> getAllOverridableAssociationMappingNames()
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(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(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.


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.