001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: JonasEjbRelationshipRole.java 4716 2004-05-10 11:45:44Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030:
031: /**
032: * This class defines the implementation of the element jonas-ejb-relationship-role
033: *
034: * @author JOnAS team
035: */
036:
037: public class JonasEjbRelationshipRole extends AbsElement {
038:
039: /**
040: * ejb-relationship-role-name
041: */
042: private String ejbRelationshipRoleName = null;
043:
044: /**
045: * foreign-key-jdbc-mapping
046: */
047: private JLinkedList foreignKeyJdbcMappingList = null;
048:
049: /**
050: * Constructor
051: */
052: public JonasEjbRelationshipRole() {
053: super ();
054: foreignKeyJdbcMappingList = new JLinkedList(
055: "foreign-key-jdbc-mapping");
056: }
057:
058: /**
059: * Gets the ejb-relationship-role-name
060: * @return the ejb-relationship-role-name
061: */
062: public String getEjbRelationshipRoleName() {
063: return ejbRelationshipRoleName;
064: }
065:
066: /**
067: * Set the ejb-relationship-role-name
068: * @param ejbRelationshipRoleName ejbRelationshipRoleName
069: */
070: public void setEjbRelationshipRoleName(
071: String ejbRelationshipRoleName) {
072: this .ejbRelationshipRoleName = ejbRelationshipRoleName;
073: }
074:
075: /**
076: * Gets the foreign-key-jdbc-mapping
077: * @return the foreign-key-jdbc-mapping
078: */
079: public JLinkedList getForeignKeyJdbcMappingList() {
080: return foreignKeyJdbcMappingList;
081: }
082:
083: /**
084: * Set the foreign-key-jdbc-mapping
085: * @param foreignKeyJdbcMappingList foreignKeyJdbcMapping
086: */
087: public void setForeignKeyJdbcMappingList(
088: JLinkedList foreignKeyJdbcMappingList) {
089: this .foreignKeyJdbcMappingList = foreignKeyJdbcMappingList;
090: }
091:
092: /**
093: * Add a new foreign-key-jdbc-mapping element to this object
094: * @param foreignKeyJdbcMapping the foreignKeyJdbcMappingobject
095: */
096: public void addForeignKeyJdbcMapping(
097: ForeignKeyJdbcMapping foreignKeyJdbcMapping) {
098: foreignKeyJdbcMappingList.add(foreignKeyJdbcMapping);
099: }
100:
101: /**
102: * Represents this element by it's XML description.
103: * @param indent use this indent for prexifing XML representation.
104: * @return the XML description of this object.
105: */
106: public String toXML(int indent) {
107: StringBuffer sb = new StringBuffer();
108: sb.append(indent(indent));
109: sb.append("<jonas-ejb-relationship-role>\n");
110:
111: indent += 2;
112:
113: // ejb-relationship-role-name
114: sb.append(xmlElement(ejbRelationshipRoleName,
115: "ejb-relationship-role-name", indent));
116: // foreign-key-jdbc-mapping
117: sb.append(foreignKeyJdbcMappingList.toXML(indent));
118: indent -= 2;
119: sb.append(indent(indent));
120: sb.append("</jonas-ejb-relationship-role>\n");
121:
122: return sb.toString();
123: }
124: }
|