Dali Provisional API
Release 3.2

org.eclipse.jpt.jpa.core.context.orm
Interface OrmPersistentAttribute

All Superinterfaces:
AccessReference, IAdaptable, JpaContextModel, JpaModel, JpaStructureNode, JptResourceTypeReference, Model, PersistentAttribute
All Known Subinterfaces:
OrmSpecifiedPersistentAttribute

public interface OrmPersistentAttribute
extends PersistentAttribute

orm.xml 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.


Nested Class Summary
static class OrmPersistentAttribute.MappingTransformer
           
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.PersistentAttribute
PersistentAttribute.NameEquals, PersistentAttribute.NameTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
JpaStructureNode.ContextType
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaModel
JpaModel.JpaVersionIsCompatibleWith
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeIsKindOf, JptResourceTypeReference.ResourceTypeTransformer
 
Field Summary
static String JAVA_PERSISTENT_ATTRIBUTE_PROPERTY
           
static org.eclipse.jpt.common.utility.transformer.Transformer<OrmPersistentAttribute,AttributeMapping> MAPPING_TRANSFORMER
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.PersistentAttribute
DEFAULT_MAPPING_KEY_PROPERTY, MAPPING_PROPERTY, NAME_PROPERTY, NAME_TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
STRUCTURE_CHILDREN_COLLECTION
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
TRANSFORMER
 
Method Summary
 OrmSpecifiedPersistentAttribute addToXml()
          Convert the (currently virtual) attribute to a specified attribute.
 OrmSpecifiedPersistentAttribute addToXml(String mappingKey)
          Convert the (currently virtual) persistent attribute to a specified attribute.
 void dispose()
           
 OrmPersistentType getDeclaringPersistentType()
          Return the persistent type that declares the attribute.
 OrmTypeMapping getDeclaringTypeMapping()
          Return the attribute's declaring persistent type's mapping (as opposed to the attribute's target type's mapping).
 JavaSpecifiedPersistentAttribute getJavaPersistentAttribute()
          If the orm.xml attribute is virtual, the returned Java attribute is also virtual; i.e. it is read-only and is not to be modified (nor are any of its parts [e.g. column]).
 JavaResourceAttribute getJavaResourceAttribute()
           
 AttributeMapping getMapping()
          A specified orm.xml attribute will return an orm.xml mapping, while a virtual attribute will return a Java mapping.
 Class<OrmPersistentAttribute> getStructureType()
          Return the structure node's type.
 boolean isFor(JavaResourceField javaResourceField)
           
 boolean isFor(JavaResourceMethod javaResourceGetter, JavaResourceMethod javaResourceSetter)
           
 JavaSpecifiedPersistentAttribute resolveJavaPersistentAttribute()
          Return the orm.xml attribute's Java attribute; which, in the case of virtual attributes, is not the same Java attribute as returned by getJavaPersistentAttribute().
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.PersistentAttribute
getDefaultMappingKey, getMappingKey, getName, getPrimaryKeyColumnName, getTypeName, getTypeName, isVirtual
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
addRootStructureNodesTo, containsOffset, getContextType, getFullTextRange, getSelectionTextRange, getStructureChildren, getStructureChildrenSize, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessReference
getAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextModel
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getParent, getPersistenceUnit, getValidationTextRange, synchronizeWithResourceModel, update, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaModel
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

MAPPING_TRANSFORMER

static final org.eclipse.jpt.common.utility.transformer.Transformer<OrmPersistentAttribute,AttributeMapping> MAPPING_TRANSFORMER

JAVA_PERSISTENT_ATTRIBUTE_PROPERTY

static final String JAVA_PERSISTENT_ATTRIBUTE_PROPERTY
See Also:
Constant Field Values
Method Detail

getStructureType

Class<OrmPersistentAttribute> getStructureType()
Description copied from interface: JpaStructureNode
Return the structure node's type. This is used to find the appropriate UI provider for building the structure node's JPA Details page.

Specified by:
getStructureType in interface JpaStructureNode

getMapping

AttributeMapping getMapping()
A specified orm.xml attribute will return an orm.xml mapping, while a virtual attribute will return a Java mapping. If the attribute is virtual, the returned (Java) mapping is also virtual; i.e. it is read-only and is not to be modified (nor are any of its parts). The modifiable Java mapping can be retrieved via the modifiable Java attribute: resolveJavaPersistentAttribute().

Specified by:
getMapping in interface PersistentAttribute

getDeclaringPersistentType

OrmPersistentType getDeclaringPersistentType()
Description copied from interface: PersistentAttribute
Return the persistent type that declares the attribute.

Specified by:
getDeclaringPersistentType in interface PersistentAttribute

getDeclaringTypeMapping

OrmTypeMapping getDeclaringTypeMapping()
Description copied from interface: PersistentAttribute
Return the attribute's declaring persistent type's mapping (as opposed to the attribute's target type's mapping).

Specified by:
getDeclaringTypeMapping in interface PersistentAttribute
See Also:
PersistentAttribute.getDeclaringPersistentType()

getJavaPersistentAttribute

JavaSpecifiedPersistentAttribute getJavaPersistentAttribute()
If the orm.xml attribute is virtual, the returned Java attribute is also virtual; i.e. it is read-only and is not to be modified (nor are any of its parts [e.g. column]). The modifiable Java attribute can be retrieved via resolveJavaPersistentAttribute().

Specified by:
getJavaPersistentAttribute in interface PersistentAttribute

resolveJavaPersistentAttribute

JavaSpecifiedPersistentAttribute resolveJavaPersistentAttribute()
Return the orm.xml attribute's Java attribute; which, in the case of virtual attributes, is not the same Java attribute as returned by getJavaPersistentAttribute().

This is probably useful only to tests; since nothing else will want to modify the returned Java attribute.


getJavaResourceAttribute

JavaResourceAttribute getJavaResourceAttribute()

isFor

boolean isFor(JavaResourceField javaResourceField)

isFor

boolean isFor(JavaResourceMethod javaResourceGetter,
              JavaResourceMethod javaResourceSetter)

addToXml

OrmSpecifiedPersistentAttribute addToXml()
Convert the (currently virtual) attribute to a specified attribute. The attribute will be added to the list of specified attributes and added to the orm.xml file. The mapping will remain the same. Return the new attribute.

See Also:
PersistentAttribute.isVirtual()

addToXml

OrmSpecifiedPersistentAttribute addToXml(String mappingKey)
Convert the (currently virtual) persistent attribute to a specified attribute. The attribute will be added to the list of specified attributes and added to the orm.xml file. The mapping will be changed according to the specified mapping key. Return the new attribute.

See Also:
PersistentAttribute.isVirtual()

dispose

void dispose()

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.