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

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, Model, TypeMapping, XmlContextNode
All Known Subinterfaces:
EclipseLinkOrmTypeMapping, OrmEclipseLinkEmbeddable, OrmEclipseLinkEntity, OrmEclipseLinkMappedSuperclass, OrmEclipseLinkNonEmbeddableTypeMapping, OrmEmbeddable, OrmEntity, OrmMappedSuperclass

public interface OrmTypeMapping
extends TypeMapping, XmlContextNode

orm.xml type mapping

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
static java.lang.String CLASS_PROPERTY
           
static java.lang.String OVERRIDE_METADATA_COMPLETE_PROPERTY
           
static java.lang.String SPECIFIED_METADATA_COMPLETE_PROPERTY
           
 
Method Summary
 void addXmlTypeMappingTo(XmlEntityMappings entityMappings)
          Add the type mapping's XML type mapping to the appropriate list in the specified XML entity mappings.
 boolean containsOffset(int textOffset)
           
 org.eclipse.text.edits.DeleteEdit createDeleteEdit()
          Create a text DeleteEdit for deleting the type mapping element and any text that precedes it
 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.
 TextRange getAttributesTextRange()
           
 java.lang.String getClass_()
          NB: This may be a partial name to be prefixed by the entity mappings's package value.
 TextRange getClassTextRange()
           
 JavaTypeMapping getJavaTypeMapping()
          Return the Java type mapping corresponding to the orm.xml type mapping.
 JavaTypeMapping getJavaTypeMappingForDefaults()
          Check "metadata complete" before returning the Java type mapping.
 OrmPersistentType getPersistentType()
           
 TextRange getSelectionTextRange()
           
 java.lang.Boolean getSpecifiedMetadataComplete()
           
 int getXmlSequence()
          Type mappings are a sequence in the orm schema.
 XmlTypeMapping getXmlTypeMapping()
           
 void initializeFrom(OrmTypeMapping oldMapping)
           
 boolean isMetadataComplete()
           
 boolean isOverrideMetadataComplete()
          Override metadata complete is true if the type mapping's persistence unit is marked "XML mapping metadata complete".
 void removeXmlTypeMappingFrom(XmlEntityMappings entityMappings)
          Remove the type mapping's XML type mapping from the appropriate list in the specified XML entity mappings.
 void setClass(java.lang.String class_)
           
 void setSpecifiedMetadataComplete(java.lang.Boolean metadataComplete)
           
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.TypeMapping
allAssociatedTableNames, allAssociatedTables, allAttributeMappings, allOverridableAssociationNames, allOverridableAttributeNames, associatedTables, attributeMappingKeyAllowed, attributeMappings, getAllAttributeMappings, getAttributeMappings, getDbSchema, getIdClass, getKey, getName, getPrimaryDbTable, getPrimaryTableName, getSuperTypeMapping, inheritanceHierarchy, isMapped, overridableAssociationNames, overridableAttributeNames, resolveDbTable, resolveOverriddenColumn, resolveOverriddenRelationship, tableNameIsInvalid, validatesAgainstDatabase
 
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.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
 

Field Detail

CLASS_PROPERTY

static final java.lang.String CLASS_PROPERTY
See Also:
Constant Field Values

SPECIFIED_METADATA_COMPLETE_PROPERTY

static final java.lang.String SPECIFIED_METADATA_COMPLETE_PROPERTY
See Also:
Constant Field Values

OVERRIDE_METADATA_COMPLETE_PROPERTY

static final java.lang.String OVERRIDE_METADATA_COMPLETE_PROPERTY
See Also:
Constant Field Values
Method Detail

getClass_

java.lang.String getClass_()
NB: This may be a partial name to be prefixed by the entity mappings's package value.

See Also:
EntityMappings.getPackage()

setClass

void setClass(java.lang.String class_)
See Also:
getClass_()

isMetadataComplete

boolean isMetadataComplete()

getSpecifiedMetadataComplete

java.lang.Boolean getSpecifiedMetadataComplete()

setSpecifiedMetadataComplete

void setSpecifiedMetadataComplete(java.lang.Boolean metadataComplete)

isOverrideMetadataComplete

boolean isOverrideMetadataComplete()
Override metadata complete is true if the type mapping's persistence unit is marked "XML mapping metadata complete".


getXmlSequence

int getXmlSequence()
Type mappings are a sequence in the orm schema. We must keep the list of type mappings in the appropriate order so the wtp xml translators will write them to the xml in that order and they will adhere to the schema.

Each concrete implementation must implement this method and return an int that matches its order in the schema.


addXmlTypeMappingTo

void addXmlTypeMappingTo(XmlEntityMappings entityMappings)
Add the type mapping's XML type mapping to the appropriate list in the specified XML entity mappings.


removeXmlTypeMappingFrom

void removeXmlTypeMappingFrom(XmlEntityMappings entityMappings)
Remove the type mapping's XML type mapping from the appropriate list in the specified XML entity mappings.


getXmlTypeMapping

XmlTypeMapping getXmlTypeMapping()

getSelectionTextRange

TextRange getSelectionTextRange()

getClassTextRange

TextRange getClassTextRange()

getAttributesTextRange

TextRange getAttributesTextRange()

containsOffset

boolean containsOffset(int textOffset)

getJavaTypeMapping

JavaTypeMapping getJavaTypeMapping()
Return the Java type mapping corresponding to the orm.xml type mapping. Return null if there is no such Java type mapping; i.e. it does not exist or it is not the same type of type mapping (entity, mapped superclass, embeddable).

See Also:
getJavaTypeMappingForDefaults()

getJavaTypeMappingForDefaults

JavaTypeMapping getJavaTypeMappingForDefaults()
Check "metadata complete" before returning the Java type mapping. For orm.xml defaults, if "metadata complete" is true, return null.

See Also:
getJavaTypeMapping()

createDeleteEdit

org.eclipse.text.edits.DeleteEdit createDeleteEdit()
Create a text DeleteEdit for deleting the type mapping element and any text that precedes it


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.


getPersistentType

OrmPersistentType getPersistentType()
Specified by:
getPersistentType in interface TypeMapping

initializeFrom

void initializeFrom(OrmTypeMapping oldMapping)