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

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

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.


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.
 JavaAttributeMapping getMapping()
          covariant override
 java.lang.String getMultiReferenceEntityTypeName()
          If the attribute's type is an appropriate "container" type, return the type parameter that can be used as a target entity.
 JavaResourcePersistentAttribute getResourcePersistentAttribute()
          Return the "resource" persistent attribute.
 java.lang.String getSingleReferenceEntityTypeName()
          Return the attribute's type name if it is valid as a target entity 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, getPersistentType, getPrimaryKeyColumnName, getTypeMapping, isIdAttribute, isOverridableAssociation, isOverridableAttribute, isVirtual, setSpecifiedMappingKey
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getContentType, getId, 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.


getSingleReferenceEntityTypeName

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


getMultiReferenceEntityTypeName

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