org.eclipse.jst.j2ee.ejb
Interface EJBRelationshipRole

All Superinterfaces:
CommonRelationshipRole, J2EEEObject

public interface EJBRelationshipRole
extends J2EEEObject, CommonRelationshipRole

The ejb-relationship-role element describes a role within a relationship. There are two roles in each relationship. The ejb-relationship-role element contains an optional description; an optional name for the relationship role; a specification of the multiplicity of the role; an optional specification of cascade-delete functionality for the role; the role source; and a declaration of the cmr-field, if any, by means of which the other side of the relationship is accessed from the perspective of the role source. The multiplicity and relationship-role-source element are mandatory. The relationship-role-source element designates an entity-bean by means of an ejb-name element. For bidirectional relationships, both roles of a relationship must declare a relationship-role-source element that specifies a cmr-field in terms of which the relationship is accessed. The lack of a cmr-field element in an ejb-relationship-role specifies that the relationship is unidirectional in navigability and that entity bean that participates in the relationship is "not aware" of the relationship.

Since:
1.0

Method Summary
 CMRField getCmrField()
           
 java.lang.String getDescription()
           
 EList getDescriptions()
          Returns the value of the 'Descriptions' containment reference list.
 java.lang.String getLogicalName()
           
 MultiplicityKind getMultiplicity()
          Returns the value of the 'Multiplicity' attribute.
 java.lang.String getName()
          Defines a name for a role that is unique within an ejb-relation.
 EJBRelationshipRole getOpposite()
          Return the other role.
 EJBRelation getRelationship()
           
 java.lang.String getRoleName()
          Return the actual name of this role.
 RoleSource getSource()
           
 ContainerManagedEntity getSourceEntity()
           
 boolean isCascadeDelete()
           
 boolean isForward()
           
 boolean isKey()
          Return whether this role is part of the key of the source EJB.
 boolean isMany()
           
 boolean isNavigable()
           
 boolean isSetCascadeDelete()
          Returns whether the value of the 'Cascade Delete' attribute is set
 boolean isSetMultiplicity()
          Returns whether the value of the 'Multiplicity' attribute is set
 void reconcileAttributes()
          Collects the attributes
 void setCascadeDelete(boolean value)
           
 void setCmrField(CMRField value)
           
 void setDescription(java.lang.String value)
           
 void setFoward()
          Set this role to be the forward role.
 void setKey(boolean aBoolean)
          This allows you to set the Role as being key so it will not traverse it attributes to determine if it is key.
 void setMultiplicity(MultiplicityKind value)
          Sets the value of the 'Multiplicity' attribute
 void setName(java.lang.String uniqueName)
           
 void setRelationship(EJBRelation value)
           
 void setRequired(java.lang.Boolean isRequired)
           
 void setRoleName(java.lang.String value)
           
 void setSource(RoleSource value)
           
 void unsetCascadeDelete()
          Unsets the value of the 'Cascade Delete' attribute
 void unsetMultiplicity()
          Unsets the value of the 'Multiplicity' attribute
 
Methods inherited from interface org.eclipse.jst.j2ee.ejb.CommonRelationshipRole
getAttributes, getCommonRelationship, getOppositeAsCommonRole, getTargetAttributeName, getTypeEntity, isRequired, setLower, setUpper
 

Method Detail

getLogicalName

public java.lang.String getLogicalName()
Returns:
The logical name which can be used for naming this role. Required to be unique within a JAR. If a cmr-field is defined, then a name in the form %source-ejb-name%_%cmr-field-name% is computed. Otherwise a default ID is generated.

getOpposite

public EJBRelationshipRole getOpposite()
Return the other role.


getName

public java.lang.String getName()
Description copied from interface: CommonRelationshipRole
Defines a name for a role that is unique within an ejb-relation. Different relationships can use the same name for a role.

Specified by:
getName in interface CommonRelationshipRole
Returns:
java.lang.String the unique name for this role

getSourceEntity

public ContainerManagedEntity getSourceEntity()
Specified by:
getSourceEntity in interface CommonRelationshipRole
Returns:
The Source ejb Compute the ContainerManagedEntity which is the source of a role that participates in a relationship.

isForward

public boolean isForward()
Specified by:
isForward in interface CommonRelationshipRole
Returns:
The computed value of the isForward attribute Specifies whether this role should be mapped to a persistent reference, such as a foreign key.

isMany

public boolean isMany()
Specified by:
isMany in interface CommonRelationshipRole
Returns:
The computed value isMany Returns whether the upper limit of our multiplicity is > 1

isNavigable

public boolean isNavigable()
Specified by:
isNavigable in interface CommonRelationshipRole
Returns:
The computed value of the isNavigable attribute Specifies that accessors should be generated for this relationship role.

setFoward

public void setFoward()
Set this role to be the forward role.


setName

public void setName(java.lang.String uniqueName)

getDescription

public java.lang.String getDescription()
Returns:
The value of the Description attribute The description is used by the ejb-jar file producer to provide text describing the ejb relationship role. The description should include any information that the ejb-jar file producer wants to provide to the consumer of the ejb-jar file (i.e. to the Deployer). Typically, the tools used by the ejb-jar file consumer will display the description when processing the list of dependents.

setDescription

public void setDescription(java.lang.String value)
Parameters:
value - The new value of the Description attribute

getRoleName

public java.lang.String getRoleName()
Description copied from interface: CommonRelationshipRole
Return the actual name of this role. This is the name defined in the Deployment Descriptor. You should use getName() for the name to use in code generation.

Specified by:
getRoleName in interface CommonRelationshipRole
Returns:
The value of the RoleName attribute Defines a name for a role that is unique within an ejb-relation. Different relationships can use the same name for a role.

setRoleName

public void setRoleName(java.lang.String value)
Parameters:
value - The new value of the RoleName attribute

getMultiplicity

public MultiplicityKind getMultiplicity()
Returns the value of the 'Multiplicity' attribute. The literals are from the enumeration MultiplicityKind.

If the meaning of the 'Multiplicity' attribute isn't clear, there really should be more of a description here...

Describes the multiplicity of the role that participates in a relation. The multiplicity element must be one of the two following: One Many

Returns:
the value of the 'Multiplicity' attribute.
See Also:
MultiplicityKind, isSetMultiplicity(), unsetMultiplicity(), setMultiplicity(MultiplicityKind), EjbPackage.getEJBRelationshipRole_Multiplicity()

setMultiplicity

public void setMultiplicity(MultiplicityKind value)
Sets the value of the 'Multiplicity' attribute.

Parameters:
value - the new value of the 'Multiplicity' attribute.
See Also:
MultiplicityKind, isSetMultiplicity(), unsetMultiplicity(), getMultiplicity()

unsetMultiplicity

public void unsetMultiplicity()
Unsets the value of the 'Multiplicity' attribute.

See Also:
isSetMultiplicity(), getMultiplicity(), setMultiplicity(MultiplicityKind)

isSetMultiplicity

public boolean isSetMultiplicity()
Returns whether the value of the 'Multiplicity' attribute is set.

Returns:
whether the value of the 'Multiplicity' attribute is set.
See Also:
unsetMultiplicity(), getMultiplicity(), setMultiplicity(MultiplicityKind)

isCascadeDelete

public boolean isCascadeDelete()
Returns:
The value of the CascadeDelete attribute Specifies that, within a particular relationship, the lifetime of one or more entity beans is dependent upon the lifetime of another entity bean. The cascade-delete element can Cascade delete can only be specified for an EJBRelationshipRole contained in an EJBrelation in which the other EJBRelationshipRole element specifies a multiplicity of One.

setCascadeDelete

public void setCascadeDelete(boolean value)
Parameters:
value - The new value of the CascadeDelete attribute

unsetCascadeDelete

public void unsetCascadeDelete()
Unsets the value of the 'Cascade Delete' attribute.

See Also:
isSetCascadeDelete(), isCascadeDelete(), setCascadeDelete(boolean)

isSetCascadeDelete

public boolean isSetCascadeDelete()
Returns whether the value of the 'Cascade Delete' attribute is set.

Returns:
whether the value of the 'Cascade Delete' attribute is set.
See Also:
unsetCascadeDelete(), isCascadeDelete(), setCascadeDelete(boolean)

getRelationship

public EJBRelation getRelationship()
Returns:
The Relationship reference

setRelationship

public void setRelationship(EJBRelation value)

setRequired

public void setRequired(java.lang.Boolean isRequired)

getSource

public RoleSource getSource()
Returns:
The Source reference Designates the source of a role that participates in a relationship. A relationship-role-source element uniquely identifies an entity bean.

setSource

public void setSource(RoleSource value)

getCmrField

public CMRField getCmrField()
Returns:
The CmrField reference A declaration of the CMRField, if any, by means of which the other side of the relationship is accessed from the perspective of the role source

setCmrField

public void setCmrField(CMRField value)

getDescriptions

public EList getDescriptions()
Returns the value of the 'Descriptions' containment reference list. The list contents are of type Description.

If the meaning of the 'Descriptions' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Descriptions' containment reference list.
See Also:
EjbPackage.getEJBRelationshipRole_Descriptions()

isKey

public boolean isKey()
Return whether this role is part of the key of the source EJB.

Specified by:
isKey in interface CommonRelationshipRole
Returns:
The computed value isKey

setKey

public void setKey(boolean aBoolean)
This allows you to set the Role as being key so it will not traverse it attributes to determine if it is key.

Specified by:
setKey in interface CommonRelationshipRole
Parameters:
aBoolean - the boolean value

reconcileAttributes

public void reconcileAttributes()
Description copied from interface: CommonRelationshipRole
Collects the attributes

Specified by:
reconcileAttributes in interface CommonRelationshipRole