1 27 package org.objectweb.jonas_ejb.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 35 36 public class EjbRelationshipRole extends AbsElement { 37 38 41 private String description = null; 42 43 46 private String ejbRelationshipRoleName = null; 47 48 51 private String multiplicity = null; 52 53 56 private boolean cascadeDelete = false; 57 58 61 private RelationshipRoleSource relationshipRoleSource = null; 62 63 66 private CmrField cmrField = null; 67 68 69 72 public EjbRelationshipRole() { 73 super(); 74 } 75 76 80 public String getDescription() { 81 return description; 82 } 83 84 88 public void setDescription(String description) { 89 this.description = description; 90 } 91 92 96 public String getEjbRelationshipRoleName() { 97 return ejbRelationshipRoleName; 98 } 99 100 104 public void setEjbRelationshipRoleName(String ejbRelationshipRoleName) { 105 this.ejbRelationshipRoleName = ejbRelationshipRoleName; 106 } 107 108 112 public String getMultiplicity() { 113 return multiplicity; 114 } 115 116 120 public void setMultiplicity(String multiplicity) { 121 this.multiplicity = multiplicity; 122 } 123 124 128 public boolean isCascadeDelete() { 129 return cascadeDelete; 130 } 131 132 135 public void setCascadeDelete() { 136 this.cascadeDelete = true; 137 } 138 139 143 public RelationshipRoleSource getRelationshipRoleSource() { 144 return relationshipRoleSource; 145 } 146 147 151 public void setRelationshipRoleSource(RelationshipRoleSource relationshipRoleSource) { 152 this.relationshipRoleSource = relationshipRoleSource; 153 } 154 155 159 public CmrField getCmrField() { 160 return cmrField; 161 } 162 163 167 public void setCmrField(CmrField cmrField) { 168 this.cmrField = cmrField; 169 } 170 171 176 public String toXML(int indent) { 177 StringBuffer sb = new StringBuffer (); 178 sb.append(indent(indent)); 179 sb.append("<ejb-relationship-role>\n"); 180 181 indent += 2; 182 183 sb.append(xmlElement(description, "description", indent)); 185 sb.append(xmlElement(ejbRelationshipRoleName, "ejb-relationship-role-name", indent)); 187 sb.append(xmlElement(multiplicity, "multiplicity", indent)); 189 if (cascadeDelete) { 191 sb.append(indent(indent)); 192 sb.append("<cascade-delete>\n"); 193 sb.append(indent(indent)); 194 sb.append("</cascade-delete>\n"); 195 } 196 if (relationshipRoleSource != null) { 198 sb.append(relationshipRoleSource.toXML(indent)); 199 } 200 if (cmrField != null) { 202 sb.append(cmrField.toXML(indent)); 203 } 204 indent -= 2; 205 sb.append(indent(indent)); 206 sb.append("</ejb-relationship-role>\n"); 207 208 return sb.toString(); 209 } 210 } 211 | Popular Tags |