/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.dd;

import java.util.ArrayList;
import java.util.List;

/**
 * Represents an ejb-relationship-role element of the ejb-jar.xml deployment
 * descriptor for the 1.4 schema
 *
 * @author <a href="mailto:bdecoste@jboss.com">William DeCoste</a>
 * @version <tt>$Revision: 1.3.2.3 $</tt>
 */
public class EjbRelationshipRole
{

   private String ejbRelationshipRoleName;

   private String multiplicity;

   private boolean cascadeDelete = false;

   private List ejbRelationshipRoles = new ArrayList();

   private RelationshipRoleSource relationshipRoleSource;;

   private CmrField cmrField;

   public String getEjbRelationshipRoleName()
   {
      return ejbRelationshipRoleName;
   }

   public void setEjbRelationshipRoleName(String ejbRelationName)
   {
      this.ejbRelationshipRoleName = ejbRelationName;
   }

   public String getMultiplicity()
   {
      return multiplicity;
   }

   public void setMultiplicity(String multiplicity)
   {
      this.multiplicity = multiplicity;
   }

   public boolean isCascadeDelete()
   {
      return cascadeDelete;
   }

   public void setCascadeDelete(boolean cascadeDelete)
   {
      this.cascadeDelete = cascadeDelete;
   }

   public List getEjbRelationshipRoles()
   {
      return ejbRelationshipRoles;
   }

   public void setEjbRelationshipRoles(List ejbRelationshipRoles)
   {
      this.ejbRelationshipRoles = ejbRelationshipRoles;
   }

   public void addEjbRelationshipRole(EjbRelationshipRole role)
   {
      ejbRelationshipRoles.add(role);
   }

   public RelationshipRoleSource getRelationshipRoleSource()
   {
      return relationshipRoleSource;
   }

   public void setRelationshipRoleSource(RelationshipRoleSource relationshipRoleSource)
   {
      this.relationshipRoleSource = relationshipRoleSource;
   }

   public CmrField getCmrField()
   {
      return cmrField;
   }

   public void setCmrField(CmrField cmrField)
   {
      this.cmrField = cmrField;
   }

   public String toString()
   {
      StringBuffer sb = new StringBuffer(100);
      sb.append("ejbRelationshipRoleName=").append(ejbRelationshipRoleName);
      return sb.toString();
   }
}
