1 27 package org.objectweb.jonas_ejb.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 30 35 36 public class Entity extends CommonEjb { 37 38 39 40 43 private String persistenceType = null; 44 45 48 private String primKeyClass = null; 49 50 53 private String reentrant = null; 54 55 58 private String cmpVersion = null; 59 60 63 private String abstractSchemaName = null; 64 65 68 private JLinkedList cmpFieldList = null; 69 70 73 private String primkeyField = null; 74 75 78 private JLinkedList queryList = null; 79 80 81 84 public Entity() { 85 super(); 86 cmpFieldList = new JLinkedList("cmp-field"); 87 queryList = new JLinkedList("query"); 88 } 89 90 94 public String getPersistenceType() { 95 return persistenceType; 96 } 97 98 102 public void setPersistenceType(String persistenceType) { 103 this.persistenceType = persistenceType; 104 } 105 106 110 public String getPrimKeyClass() { 111 return primKeyClass; 112 } 113 114 118 public void setPrimKeyClass(String primKeyClass) { 119 this.primKeyClass = primKeyClass; 120 } 121 122 126 public String getReentrant() { 127 return reentrant; 128 } 129 130 134 public void setReentrant(String reentrant) { 135 this.reentrant = reentrant; 136 } 137 138 142 public String getCmpVersion() { 143 return cmpVersion; 144 } 145 146 150 public void setCmpVersion(String cmpVersion) { 151 this.cmpVersion = cmpVersion; 152 } 153 154 158 public String getAbstractSchemaName() { 159 return abstractSchemaName; 160 } 161 162 166 public void setAbstractSchemaName(String abstractSchemaName) { 167 this.abstractSchemaName = abstractSchemaName; 168 } 169 170 174 public JLinkedList getCmpFieldList() { 175 return cmpFieldList; 176 } 177 178 182 public void setCmpFieldList(JLinkedList cmpFieldList) { 183 this.cmpFieldList = cmpFieldList; 184 } 185 186 190 public void addCmpField(CmpField cmpField) { 191 cmpFieldList.add(cmpField); 192 } 193 194 198 public String getPrimkeyField() { 199 return primkeyField; 200 } 201 202 206 public void setPrimkeyField(String primkeyField) { 207 this.primkeyField = primkeyField; 208 } 209 210 211 215 public JLinkedList getQueryList() { 216 return queryList; 217 } 218 219 223 public void setQueryList(JLinkedList queryList) { 224 this.queryList = queryList; 225 } 226 227 231 public void addQuery(Query query) { 232 queryList.add(query); 233 } 234 235 240 public String toXML(int indent) { 241 StringBuffer sb = new StringBuffer (); 242 sb.append(indent(indent)); 243 sb.append("<entity>\n"); 244 245 indent += 2; 246 247 sb.append(xmlElement(getDescription(), "description", indent)); 249 sb.append(xmlElement(getDisplayName(), "display-name", indent)); 251 sb.append(xmlElement(getIcon().getSmallIcon(), "small-icon", indent)); 253 sb.append(xmlElement(getIcon().getLargeIcon(), "large-icon", indent)); 255 sb.append(xmlElement(getEjbName(), "ejb-name", indent)); 257 sb.append(xmlElement(getHome(), "home", indent)); 259 sb.append(xmlElement(getRemote(), "remote", indent)); 261 sb.append(xmlElement(getLocalHome(), "local-home", indent)); 263 sb.append(xmlElement(getLocal(), "local", indent)); 265 sb.append(xmlElement(getEjbClass(), "ejb-class", indent)); 267 sb.append(xmlElement(persistenceType, "persistence-type", indent)); 269 sb.append(xmlElement(primKeyClass, "prim-key-class", indent)); 271 sb.append(xmlElement(reentrant, "reentrant", indent)); 273 sb.append(xmlElement(cmpVersion, "cmp-version", indent)); 275 sb.append(xmlElement(abstractSchemaName, "abstract-schema-name", indent)); 277 sb.append(cmpFieldList.toXML(indent)); 279 sb.append(xmlElement(primkeyField, "primkey-field", indent)); 281 sb.append(getEnvEntryList().toXML(indent)); 283 sb.append(getEjbRefList().toXML(indent)); 285 sb.append(getEjbLocalRefList().toXML(indent)); 287 sb.append(getServiceRefList().toXML(indent)); 289 sb.append(getResourceRefList().toXML(indent)); 291 sb.append(getResourceEnvRefList().toXML(indent)); 293 sb.append(getMessageDestinationRefList().toXML(indent)); 295 sb.append(getSecurityRoleRefList().toXML(indent)); 297 if (getSecurityIdentity() != null) { 299 sb.append(getSecurityIdentity().toXML(indent)); 300 } 301 sb.append(queryList.toXML(indent)); 303 indent -= 2; 304 sb.append(indent(indent)); 305 sb.append("</entity>\n"); 306 307 return sb.toString(); 308 } 309 } 310 | Popular Tags |