org.objectweb.jonas_ejb.deployment.api
Class EjbRelationshipRoleDesc

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.deployment.api.EjbRelationshipRoleDesc

public class EjbRelationshipRoleDesc
extends java.lang.Object

Class to hold meta-information related to an ejb-relation-role Created on Jul 7, 2002

Author:
Christophe Ney [cney@batisseurs.com]

Field Summary
protected  java.lang.String cmrFieldName
           
protected  java.lang.Class cmrFieldType
           
static byte INDEX
          This constant can be used to represent an index of a gen class.
protected  boolean isJOnASCMR
           
static byte MMB
           
static byte MMU
           
static byte MOB
           
static byte MOU
           
static byte OMB
           
static byte OMU
           
static byte OOB
           
static byte OOU
           
static byte SOURCE
          This constant can be used to represent the source of the relation, ie the element which references the other.
static byte TARGET
          This constant can be used to represent the target of the relation, ie the element which is referenced by the other.
 
Constructor Summary
EjbRelationshipRoleDesc(org.objectweb.jonas_ejb.deployment.xml.EjbRelationshipRole role, boolean target, EjbRelationDesc ejbRelationDesc, org.objectweb.jonas_ejb.deployment.xml.EjbRelation ejbRelation)
          constructor to be used by parent node
 
Method Summary
 java.lang.String getCmrFieldName()
          get the name of the cmr-field
 java.lang.Class getCmrFieldType()
          get the type of the cmr-field when set in the deployment descriptor.
 java.lang.String getEjbName()
          get name of the ejb involved in this relation-ship-role
 EjbRelationDesc getEjbRelationDesc()
          get the parent ejb relation
 EntityCmp2Desc getLinkedEntityCmp2Desc()
          It retrieves the EntityCmp2Desc which is linked to the EntityCmp2Desc associated to this EjbRelationshipRoleDesc.
 EjbRelationshipRoleDesc getOppositeEjbRelationshipRoleDesc()
           
 byte getRelationType()
           
 boolean hasCmrField()
          It retrieves true if the EntityCmp2Desc associated to this EjbRelationshipRoleDesc has a cmr field to the linked EntityCmp2Desc
 boolean isCascadeDelete()
          get state of field cascade delete
 boolean isJOnASCMR()
          It returns a boolean value which indicates if the cmr has been added by JOnAS (true) or if the user has specified a cmr field in the descriptor.
 boolean isMultiValuedCMR()
          get state of field is relation multiple
 boolean isTarget()
          It retrieves true if the EntityCmp2Desc associated to this EjbRelationshipRoleDesc is the target of the cmr field associated the linked EntityCmp2Desc.
 void setCMRFieldName(java.lang.String name)
           
 void setCMRFieldType(java.lang.String type)
           
 void setIsJOnASCMR(boolean b)
          mark the cmr as added by JOnAS
 void setLinkedEntityCmp2Desc(EntityCmp2Desc linkedEntityCmp2Desc)
          set the linkedEntityCmp2Desc field.
 java.lang.String toString()
          String representation of the object for test purpose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEX

public static final byte INDEX
This constant can be used to represent an index of a gen class.

SOURCE

public static final byte SOURCE
This constant can be used to represent the source of the relation, ie the element which references the other.

TARGET

public static final byte TARGET
This constant can be used to represent the target of the relation, ie the element which is referenced by the other.

OOU

public static final byte OOU

OOB

public static final byte OOB

OMU

public static final byte OMU

OMB

public static final byte OMB

MOU

public static final byte MOU

MOB

public static final byte MOB

MMU

public static final byte MMU

MMB

public static final byte MMB

cmrFieldName

protected java.lang.String cmrFieldName

cmrFieldType

protected java.lang.Class cmrFieldType

isJOnASCMR

protected boolean isJOnASCMR
Constructor Detail

EjbRelationshipRoleDesc

public EjbRelationshipRoleDesc(org.objectweb.jonas_ejb.deployment.xml.EjbRelationshipRole role,
                               boolean target,
                               EjbRelationDesc ejbRelationDesc,
                               org.objectweb.jonas_ejb.deployment.xml.EjbRelation ejbRelation)
                        throws DeploymentDescException
constructor to be used by parent node
Method Detail

setCMRFieldName

public void setCMRFieldName(java.lang.String name)
                     throws DeploymentDescException

setCMRFieldType

public void setCMRFieldType(java.lang.String type)
                     throws DeploymentDescException

setIsJOnASCMR

public void setIsJOnASCMR(boolean b)
mark the cmr as added by JOnAS

isJOnASCMR

public boolean isJOnASCMR()
It returns a boolean value which indicates if the cmr has been added by JOnAS (true) or if the user has specified a cmr field in the descriptor. A CMR field is be added to manage the coherence of the relation OXu

isCascadeDelete

public boolean isCascadeDelete()
get state of field cascade delete

isMultiValuedCMR

public boolean isMultiValuedCMR()
get state of field is relation multiple

getEjbName

public java.lang.String getEjbName()
get name of the ejb involved in this relation-ship-role

getEjbRelationDesc

public EjbRelationDesc getEjbRelationDesc()
get the parent ejb relation

getOppositeEjbRelationshipRoleDesc

public EjbRelationshipRoleDesc getOppositeEjbRelationshipRoleDesc()

getLinkedEntityCmp2Desc

public EntityCmp2Desc getLinkedEntityCmp2Desc()
It retrieves the EntityCmp2Desc which is linked to the EntityCmp2Desc associated to this EjbRelationshipRoleDesc.

setLinkedEntityCmp2Desc

public void setLinkedEntityCmp2Desc(EntityCmp2Desc linkedEntityCmp2Desc)
set the linkedEntityCmp2Desc field.

hasCmrField

public boolean hasCmrField()
It retrieves true if the EntityCmp2Desc associated to this EjbRelationshipRoleDesc has a cmr field to the linked EntityCmp2Desc

isTarget

public boolean isTarget()
It retrieves true if the EntityCmp2Desc associated to this EjbRelationshipRoleDesc is the target of the cmr field associated the linked EntityCmp2Desc.

getCmrFieldName

public java.lang.String getCmrFieldName()
get the name of the cmr-field

getCmrFieldType

public java.lang.Class getCmrFieldType()
get the type of the cmr-field when set in the deployment descriptor.
Returns:
Collection or Set for multiple rel. and null for non multiple rel.

getRelationType

public byte getRelationType()

toString

public java.lang.String toString()
String representation of the object for test purpose
Overrides:
toString in class java.lang.Object
Returns:
String representation of this object