KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > CmpFieldJdbcMapping


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: CmpFieldJdbcMapping.java,v 1.9 2004/05/10 11:45:44 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 /**
31  * This class defines the implementation of the element cmp-field-jdbc-mapping
32  *
33  * @author JOnAS team
34  */

35
36 public class CmpFieldJdbcMapping extends AbsElement {
37
38     /**
39      * field-name
40      */

41     private String JavaDoc fieldName = null;
42
43     /**
44      * jdbc-field-name
45      */

46     private String JavaDoc jdbcFieldName = null;
47
48     /**
49      * sql-type
50      */

51     private String JavaDoc sqlType = null;
52
53
54     /**
55      * Constructor
56      */

57     public CmpFieldJdbcMapping() {
58         super();
59     }
60
61     /**
62      * Gets the field-name
63      * @return the field-name
64      */

65     public String JavaDoc getFieldName() {
66         return fieldName;
67     }
68
69     /**
70      * Set the field-name
71      * @param fieldName fieldName
72      */

73     public void setFieldName(String JavaDoc fieldName) {
74         this.fieldName = fieldName;
75     }
76
77     /**
78      * Gets the jdbc-field-name
79      * @return the jdbc-field-name
80      */

81     public String JavaDoc getJdbcFieldName() {
82         return jdbcFieldName;
83     }
84
85     /**
86      * Set the jdbc-field-name
87      * @param jdbcFieldName jdbcFieldName
88      */

89     public void setJdbcFieldName(String JavaDoc jdbcFieldName) {
90         this.jdbcFieldName = jdbcFieldName;
91     }
92
93     /**
94      * Gets the sql-type
95      * @return the sql-type
96      */

97     public String JavaDoc getSqlType() {
98         return sqlType;
99     }
100
101     /**
102      * Set the sql-type
103      * @param sqlType sqlType
104      */

105     public void setSqlType(String JavaDoc sqlType) {
106         this.sqlType = sqlType;
107     }
108
109     /**
110      * Represents this element by it's XML description.
111      * @param indent use this indent for prexifing XML representation.
112      * @return the XML description of this object.
113      */

114     public String JavaDoc toXML(int indent) {
115         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
116         sb.append(indent(indent));
117         sb.append("<cmp-field-jdbc-mapping>\n");
118
119         indent += 2;
120
121         // field-name
122
sb.append(xmlElement(fieldName, "field-name", indent));
123         // jdbc-field-name
124
sb.append(xmlElement(jdbcFieldName, "jdbc-field-name", indent));
125         // sql-type
126
sb.append(xmlElement(sqlType, "sql-type", indent));
127         indent -= 2;
128         sb.append(indent(indent));
129         sb.append("</cmp-field-jdbc-mapping>\n");
130
131         return sb.toString();
132     }
133 }
134
Popular Tags