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

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

public interface JavaPersistentAttribute
extends PersistentAttribute, JavaJpaContextNode

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.JpaContainer
          JPA container interface (and null implementation)
 
Field Summary
 
Fields inherited from interface org.eclipse.jpt.core.context.PersistentAttribute
DEFAULT_MAPPING_PROPERTY, NAME_PROPERTY, SPECIFIED_MAPPING_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.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 the text file.
 JavaAttributeMapping getDefaultMapping()
          Return the attribute's default mapping.
 Embeddable getEmbeddable()
          Return the embeddable (type mapping) corresponding to the persistent attribute's type.
 JavaPersistentAttribute.JpaContainer getJpaContainer()
          Return the JpaContainer that corresponds to this attribute's type.
 JavaAttributeMapping getMapping()
          covariant override
 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 "resource" persistent attribute.
 java.lang.String getSingleReferenceTargetTypeName()
          Return the attribute's type name if it is valid as a target type (i.e.
 JavaAttributeMapping getSpecifiedMapping()
          covariant override
 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.
 boolean mappingIsDefault(JavaAttributeMapping mapping)
          Return whether the specified mapping is the attribute's default mapping.
 boolean typeIsBasic()
          Return whether the attribute's type is valid for a default Basic mapping.
 void update()
          Update the context persistent attribute to match its resource persistent attribute (passed in to the constructor).
 
Methods inherited from interface org.eclipse.jpt.core.context.PersistentAttribute
getDefaultMappingKey, getMappingKey, getName, getOwningPersistentType, getOwningTypeMapping, getPrimaryKeyColumnName, getTypeName, isVirtual, setSpecifiedMappingKey
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.core.context.AccessHolder
getAccess, getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.core.context.java.JavaJpaContextNode
getValidationTextRange, javaCompletionProposals, validate
 

Method Detail

getMapping

JavaAttributeMapping getMapping()
covariant override

Specified by:
getMapping in interface PersistentAttribute

getSpecifiedMapping

JavaAttributeMapping getSpecifiedMapping()
covariant override

Specified by:
getSpecifiedMapping in interface PersistentAttribute

getDefaultMapping

JavaAttributeMapping getDefaultMapping()
Return the attribute's default mapping.


update

void update()
Update the context persistent attribute to match its resource persistent attribute (passed in to the constructor).

See Also:
JpaProject.update()

getResourcePersistentAttribute

JavaResourcePersistentAttribute getResourcePersistentAttribute()
Return the "resource" persistent attribute.


mappingIsDefault

boolean mappingIsDefault(JavaAttributeMapping mapping)
Return whether the specified mapping is the attribute's default mapping.


contains

boolean contains(int offset,
                 org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return whether the attribute contains the given offset into the text 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").


getJpaContainer

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