org.eclipse.jpt.jpa.core.context.java
Interface JavaPersistentAttribute

All Superinterfaces:
AccessHolder, org.eclipse.core.runtime.IAdaptable, IResourcePart, JavaJpaContextNode, JpaContextNode, JpaNode, JpaStructureNode, Model, PersistentAttribute, ReadOnlyAccessHolder, ReadOnlyPersistentAttribute
All Known Subinterfaces:
JavaPersistentAttribute2_0

public interface JavaPersistentAttribute
extends PersistentAttribute, JavaJpaContextNode

Context Java persistent attribute (field or property).

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

Nested Class Summary
static interface JavaPersistentAttribute.JpaContainerDefinition
          JPA container definition interface (and null implementation)
 
Field Summary
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute
DEFAULT_MAPPING_KEY_PROPERTY, MAPPING_PROPERTY, NAME_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
DEFAULT_ACCESS_PROPERTY, SPECIFIED_ACCESS_PROPERTY
 
Method Summary
 boolean contains(int offset, org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return whether the attribute contains the given offset into its Java source code file.
 Embeddable getEmbeddable()
          Return the embeddable (type mapping) corresponding to the persistent attribute's type.
 JavaPersistentAttribute.JpaContainerDefinition getJpaContainerDefinition()
          Return the JpaContainer that corresponds to this attribute's type.
 JavaAttributeMapping getMapping()
          Return the attribute's mapping.
 java.lang.String getMultiReferenceMapKeyTypeName()
          If the attribute's type is a map type, return the type parameter that can be used as a key type.
 java.lang.String getMultiReferenceTargetTypeName()
          If the attribute's type is an appropriate "container" type, return the type parameter that can be used as a target type.
 JavaResourcePersistentAttribute getResourcePersistentAttribute()
          Return the corresponding resource persistent attribute.
 java.lang.String getSingleReferenceTargetTypeName()
          Return the attribute's type name if it is valid as a target type (i.e.
 boolean isField()
          Return whether the attribute is a field (as opposed to a property).
 boolean isFinal()
          Return whether the attribute is final, which is problematic.
 boolean isProperty()
          Return whether the attribute is a property (as opposed to a field).
 boolean isPublic()
          Return whether the attribute is public, which is problematic for fields.
 JavaAttributeMapping setMappingKey(java.lang.String key)
          Set the attribute's mapping.
 boolean typeIsBasic()
          Return whether the attribute's type is valid for a default basic mapping.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute
getDefaultMappingKey, getJavaPersistentAttribute, getMappingKey, getName, getOwningPersistentType, getOwningTypeMapping, getPrimaryKeyColumnName, getTypeName, isVirtual
 
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.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
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
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyAccessHolder
getAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode
getValidationTextRange, javaCompletionProposals, validate
 

Method Detail

getMapping

JavaAttributeMapping getMapping()
Description copied from interface: ReadOnlyPersistentAttribute
Return the attribute's mapping. This is never null (although, it may be a null mapping). Set the mapping via PersistentAttribute.setMappingKey(String).

Specified by:
getMapping in interface ReadOnlyPersistentAttribute

setMappingKey

JavaAttributeMapping setMappingKey(java.lang.String key)
Description copied from interface: PersistentAttribute
Set the attribute's mapping. If the specified key is null, clear the specified mapping, allowing the attribute's mapping to default (if appropriate). Return the new mapping (which may be a null mapping).

Specified by:
setMappingKey in interface PersistentAttribute

getResourcePersistentAttribute

JavaResourcePersistentAttribute getResourcePersistentAttribute()
Return the corresponding resource persistent attribute.


contains

boolean contains(int offset,
                 org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return whether the attribute contains the given offset into its Java source code file.


getEmbeddable

Embeddable getEmbeddable()
Return the embeddable (type mapping) corresponding to the persistent attribute's type. Return null if it is not found.


isField

boolean isField()
Return whether the attribute is a field (as opposed to a property).


isProperty

boolean isProperty()
Return whether the attribute is a property (as opposed to a field).


isPublic

boolean isPublic()
Return whether the attribute is public, which is problematic for fields.


isFinal

boolean isFinal()
Return whether the attribute is final, which is problematic.


typeIsBasic

boolean typeIsBasic()
Return whether the attribute's type is valid for a default basic mapping.


getSingleReferenceTargetTypeName

java.lang.String getSingleReferenceTargetTypeName()
Return the attribute's type name if it is valid as a target type (i.e. the type is neither an array nor a "container").


getMultiReferenceTargetTypeName

java.lang.String getMultiReferenceTargetTypeName()
If the attribute's type is an appropriate "container" type, return the type parameter that can be used as a target type. Return null if the attribute is not a container or if the type parameter is not valid as a target type (i.e. it is either an array or a "container").


getMultiReferenceMapKeyTypeName

java.lang.String getMultiReferenceMapKeyTypeName()
If the attribute's type is a map type, return the type parameter that can be used as a key type. Return null if the attribute is not a map or if the type parameter is not valid as a key type (i.e. it is either an array or a "container").


getJpaContainerDefinition

JavaPersistentAttribute.JpaContainerDefinition getJpaContainerDefinition()
Return the JpaContainer that corresponds to this attribute's type. Return a null implementation if the type is not a container (map or collection)