org.eclipse.jpt.core.resource.java
Interface RelationshipMappingAnnotation

All Superinterfaces:
JavaResourceNode, Model
All Known Subinterfaces:
ManyToManyAnnotation, ManyToOneAnnotation, OneToManyAnnotation, OneToOneAnnotation

public interface RelationshipMappingAnnotation
extends JavaResourceNode

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
static java.lang.String CASCADE_ALL_PROPERTY
           
static java.lang.String CASCADE_MERGE_PROPERTY
           
static java.lang.String CASCADE_PERSIST_PROPERTY
           
static java.lang.String CASCADE_REFRESH_PROPERTY
           
static java.lang.String CASCADE_REMOVE_PROPERTY
           
static java.lang.String FETCH_PROPERTY
           
static java.lang.String FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY
           
static java.lang.String TARGET_ENTITY_PROPERTY
           
 
Method Summary
 TextRange getCascadeTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the TextRange for the cascade element.
 FetchType getFetch()
          Corresponds to the fetch element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
 TextRange getFetchTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the TextRange for the fetch element.
 java.lang.String getFullyQualifiedTargetEntity()
          Returns the qualified targetEntity name as it is resolved in the AST
 java.lang.String getTargetEntity()
          Corresponds to the targetEntity element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
 TextRange getTargetEntityTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the TextRange for the targetEntity element.
 boolean isCascadeAll()
           
 boolean isCascadeMerge()
           
 boolean isCascadePersist()
           
 boolean isCascadeRefresh()
           
 boolean isCascadeRemove()
           
 void setCascadeAll(boolean all)
           
 void setCascadeMerge(boolean merge)
           
 void setCascadePersist(boolean persist)
           
 void setCascadeRefresh(boolean refresh)
           
 void setCascadeRemove(boolean remove)
           
 void setFetch(FetchType fetch)
          Corresponds to the fetch element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
 void setTargetEntity(java.lang.String targetEntity)
          Corresponds to the targetEntity of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
 
Methods inherited from interface org.eclipse.jpt.core.resource.java.JavaResourceNode
getJpaCompilationUnit, getResourceModel, getTextRange, initialize, updateFromJava
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 

Field Detail

TARGET_ENTITY_PROPERTY

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

FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY

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

FETCH_PROPERTY

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

CASCADE_ALL_PROPERTY

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

CASCADE_MERGE_PROPERTY

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

CASCADE_PERSIST_PROPERTY

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

CASCADE_REFRESH_PROPERTY

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

CASCADE_REMOVE_PROPERTY

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

getTargetEntity

java.lang.String getTargetEntity()
Corresponds to the targetEntity element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne). Returns null if the targetEntity element does not exist in java. Returns the portion of the targetEntity preceding the .class.

@ManyToMany(targetEntity=Employee.class)

will return "Employee"


setTargetEntity

void setTargetEntity(java.lang.String targetEntity)
Corresponds to the targetEntity of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne). Set to null to remove the targetEntity element.


getFullyQualifiedTargetEntity

java.lang.String getFullyQualifiedTargetEntity()
Returns the qualified targetEntity name as it is resolved in the AST

@ManyToMany(targetEntity=Employee.class)

will return "model.Employee" if there is an import for model.Employee

Returns:

getFetch

FetchType getFetch()
Corresponds to the fetch element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne). Returns null if the fetch element does not exist in java.


setFetch

void setFetch(FetchType fetch)
Corresponds to the fetch element of the relationship annotations (ManyToMany, OneToMany, ManyToOne, OneToOne). Set to null to remove the fetch element.


isCascadeAll

boolean isCascadeAll()

setCascadeAll

void setCascadeAll(boolean all)

isCascadeMerge

boolean isCascadeMerge()

setCascadeMerge

void setCascadeMerge(boolean merge)

isCascadePersist

boolean isCascadePersist()

setCascadePersist

void setCascadePersist(boolean persist)

isCascadeRefresh

boolean isCascadeRefresh()

setCascadeRefresh

void setCascadeRefresh(boolean refresh)

isCascadeRemove

boolean isCascadeRemove()

setCascadeRemove

void setCascadeRemove(boolean remove)

getTargetEntityTextRange

TextRange getTargetEntityTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return the TextRange for the targetEntity element. If the targetEntity element does not exist return the TextRange for the mapping annotation.


getFetchTextRange

TextRange getFetchTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return the TextRange for the fetch element. If the fetch element does not exist return the TextRange for the mapping annotation.


getCascadeTextRange

TextRange getCascadeTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return the TextRange for the cascade element. If the cascade element does not exist return the TextRange for the mapping annotation.