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

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

public interface OrmPersistentAttribute
extends PersistentAttribute, OrmReadOnlyPersistentAttribute

Context 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.

Since:
2.0
Version:
3.0

Field Summary
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
DEFAULT_ACCESS_PROPERTY, SPECIFIED_ACCESS_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute
JAVA_PERSISTENT_ATTRIBUTE_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute
DEFAULT_MAPPING_KEY_PROPERTY, MAPPING_PROPERTY, NAME_PROPERTY
 
Method Summary
 OrmReadOnlyPersistentAttribute convertToVirtual()
          Convert the (currently specified) attribute to a virtual attribute.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType, org.eclipse.jdt.core.IPackageFragment newPackage)
          Create ReplaceEdits for moving any references to the originalType to the newPackage.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalPackage to the newName.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType, java.lang.String newName)
          Create ReplaceEdits for renaming any references to the originalType to the newName.
 OrmAttributeMapping getMapping()
          Return an orm.xml mapping since the attribute is specified.
 void nameChanged(java.lang.String oldName, java.lang.String newName)
          Called by the attribute's mapping when it's name changes, effectively changing the attribute's name.
 OrmAttributeMapping setMappingKey(java.lang.String key)
          Set the attribute's mapping.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute
contains, convertToSpecified, convertToSpecified, getJavaPersistentAttribute, getJavaResourcePersistentAttribute, getOwningPersistentType, getOwningTypeMapping, resolveJavaPersistentAttribute
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute
getDefaultMappingKey, getMappingKey, getName, getPrimaryKeyColumnName, getTypeName, isVirtual
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyAccessHolder
getAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.XmlContextNode
getValidationTextRange, validate
 
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.JpaNode
getJpaProject, getParent, stateChanged
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.IResourcePart
getResource
 

Method Detail

getMapping

OrmAttributeMapping getMapping()
Return an orm.xml mapping since the attribute is specified.

Specified by:
getMapping in interface OrmReadOnlyPersistentAttribute
Specified by:
getMapping in interface ReadOnlyPersistentAttribute

convertToVirtual

OrmReadOnlyPersistentAttribute convertToVirtual()
Convert the (currently specified) attribute to a virtual attribute. The attribute will be removed from the list of specified attributes and removed from the orm.xml file. Return the new attribute. Return null if the attribute does not correspond to an attribute in the Java persistent type.

See Also:
ReadOnlyPersistentAttribute.isVirtual(), setMappingKey(String)

setMappingKey

OrmAttributeMapping 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

nameChanged

void nameChanged(java.lang.String oldName,
                 java.lang.String newName)
Called by the attribute's mapping when it's name changes, effectively changing the attribute's name.


createRenameTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                             java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalType to the newName. The originalType has not yet been renamed, the newName is the new short name.


createMoveTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                           org.eclipse.jdt.core.IPackageFragment newPackage)
Create ReplaceEdits for moving any references to the originalType to the newPackage. The originalType has not yet been moved.


createRenamePackageEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage,
                                                                                java.lang.String newName)
Create ReplaceEdits for renaming any references to the originalPackage to the newName. The originalPackage has not yet been renamed.