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: CmpFieldJdbcMapping.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:
030: /**
031: * This class defines the implementation of the element cmp-field-jdbc-mapping
032: *
033: * @author JOnAS team
034: */
035:
036: public class CmpFieldJdbcMapping extends AbsElement {
037:
038: /**
039: * field-name
040: */
041: private String fieldName = null;
042:
043: /**
044: * jdbc-field-name
045: */
046: private String jdbcFieldName = null;
047:
048: /**
049: * sql-type
050: */
051: private String sqlType = null;
052:
053: /**
054: * Constructor
055: */
056: public CmpFieldJdbcMapping() {
057: super ();
058: }
059:
060: /**
061: * Gets the field-name
062: * @return the field-name
063: */
064: public String getFieldName() {
065: return fieldName;
066: }
067:
068: /**
069: * Set the field-name
070: * @param fieldName fieldName
071: */
072: public void setFieldName(String fieldName) {
073: this .fieldName = fieldName;
074: }
075:
076: /**
077: * Gets the jdbc-field-name
078: * @return the jdbc-field-name
079: */
080: public String getJdbcFieldName() {
081: return jdbcFieldName;
082: }
083:
084: /**
085: * Set the jdbc-field-name
086: * @param jdbcFieldName jdbcFieldName
087: */
088: public void setJdbcFieldName(String jdbcFieldName) {
089: this .jdbcFieldName = jdbcFieldName;
090: }
091:
092: /**
093: * Gets the sql-type
094: * @return the sql-type
095: */
096: public String getSqlType() {
097: return sqlType;
098: }
099:
100: /**
101: * Set the sql-type
102: * @param sqlType sqlType
103: */
104: public void setSqlType(String sqlType) {
105: this .sqlType = sqlType;
106: }
107:
108: /**
109: * Represents this element by it's XML description.
110: * @param indent use this indent for prexifing XML representation.
111: * @return the XML description of this object.
112: */
113: public String toXML(int indent) {
114: StringBuffer sb = new StringBuffer();
115: sb.append(indent(indent));
116: sb.append("<cmp-field-jdbc-mapping>\n");
117:
118: indent += 2;
119:
120: // field-name
121: sb.append(xmlElement(fieldName, "field-name", indent));
122: // jdbc-field-name
123: sb.append(xmlElement(jdbcFieldName, "jdbc-field-name", indent));
124: // sql-type
125: sb.append(xmlElement(sqlType, "sql-type", indent));
126: indent -= 2;
127: sb.append(indent(indent));
128: sb.append("</cmp-field-jdbc-mapping>\n");
129:
130: return sb.toString();
131: }
132: }
|