01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: FieldJdbcDesc.java 5450 2004-09-17 09:44:19Z joaninh $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ejb.deployment.api;
25:
26: /**
27: * Class to hold meta-information related to a cmp-field of a bean with jdbc based store
28: * @author Christophe Ney [cney@batisseurs.com] : Initial developer
29: * @author Helene Joanin on May 2003: code cleanup
30: * @author Helene Joanin on May 2003: add sqlType.
31: */
32: // TODO : Remove this class and merge it with the FieldDesc class.
33: public class FieldJdbcDesc extends FieldDesc {
34:
35: protected String jdbcFieldName = null;
36: protected String sqlType = null;
37:
38: /**
39: * Get database field name in the table where bean is stored
40: * @return Name of the field in the database
41: */
42: public String getJdbcFieldName() {
43: return jdbcFieldName;
44: }
45:
46: /**
47: * Jdbc field name setter.
48: */
49: protected void setJdbcFieldName(String jdbcFieldName) {
50: this .jdbcFieldName = jdbcFieldName;
51: }
52:
53: /**
54: * Is the field sql-type is defined.
55: * @return true if the sql-type of the field is defined.
56: */
57: public boolean hasSqlType() {
58: return (sqlType != null);
59: }
60:
61: /**
62: * Get field sql-type
63: * @return sql-type of the field in the database
64: */
65: public String getSqlType() {
66: return sqlType;
67: }
68:
69: /**
70: * Field sql-type setter.
71: */
72: protected void setSqlType(String st) {
73: sqlType = st;
74: }
75:
76: /**
77: * String representation of the object for test purpose
78: * @return String representation of this object
79: */
80: public String toString() {
81: StringBuffer ret = new StringBuffer();
82: ret.append(super .toString());
83: ret.append("\ngetJdbcFieldName()=" + getJdbcFieldName());
84: if (hasSqlType()) {
85: ret.append("\ngetSqlType()=" + getSqlType());
86: }
87: return ret.toString();
88: }
89:
90: }
|