From: <jbo...@li...> - 2006-07-10 19:08:39
|
Author: estebanschifman Date: 2006-07-10 15:08:30 -0400 (Mon, 10 Jul 2006) New Revision: 4978 Added: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/AbstractBobjStore.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/ItfStorable.java Removed: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlDbTable.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlField.java Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/BobjStore.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoBatchTable.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoIndexTable.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoSnapTable.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoUidTable.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/RowBatch.java Log: Repackage BobjStore class and all persistence details Copied: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore (from rev 4907, labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables) Copied: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/AbstractBobjStore.java (from rev 4907, labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java) =================================================================== --- labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/AbstractBobjStore.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -0,0 +1,193 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2006, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + +package org.jboss.soa.esb.internal.core.objectstore; + +import org.jboss.soa.esb.util.BaseBusinessObject; + +public abstract class AbstractBobjStore +{ + public static AbstractBobjStore getInstance() + { throw new UnsupportedOperationException( + "getInstance() must be implemented in the derived class"); + } //__________________________________ + + /** + * Array of BobjStore objects. + * @return AbstractBobjStore[] + */ + public abstract AbstractBobjStore[] getBobjStoreTable(); + + /** + * String names for BobjStoreTable. + * @return String[] + */ + public abstract String[] getBobjStoreIndex(); + + protected String m_sSnapType , m_sSnapTbl , m_sLocTbl, m_sClass; + protected boolean m_bEncrypt=false; + + /** + * Snapshot type getter - The value assigned to this attribute will help if + * standard SQL queries are required to surf the Object Store's snapshot tables + * @return String - Value of snapshot type + */ + public String getSnapType() { return m_sSnapType; } + /** + * Snapshot tablename getter - The value assigned to this attribute is the + * name of the snapshot table for this object + * @return String - name of SQL table where snapshots of objects will be stored + */ + public String getSnapTable() { return m_sSnapTbl; } + /** + * Locator tablename getter - Locator table are also called index tables. + * The value assigned to this attribute is the name of the locator table for + * this object + * @return String - name of SQL table where locators for objects will be stored + * @see BusinessObject#getObjLocator() + */ + public String getLocatorTable() { return m_sLocTbl; } + /** + * Encryption requirement getter + * @return boolean - true if Objects stored using this descriptor have to be + * encrypted - decrypted at storage/retrieval time + */ + public boolean isEncrypted() { return m_bEncrypt; } + /** + * Static helper method to obtain the snapshot type by index mnemonic + * @param p_i int - Index of descriptor in static descriptor table + * @return String + * @see BobjStore#getSnapType() + * @see BobjStore#getIndex(Class) + */ + public String getSnapType(int p_i) { return getBobjStoreTable()[p_i].m_sSnapType; } + /** + * Static helper method to obtain the snapshot SQL tablename by index mnemonic + * @param p_i int - Index of descriptor in static descriptor table + * @return String + * @see BobjStore#getSnapTable() + * @see BobjStore#getIndex(Class) + */ + public String getSnapTable(int p_i) { return getBobjStoreTable()[p_i].m_sSnapTbl; } + /** + * Static helper method to obtain the locator SQL tablename by index mnemonic + * @param p_i int - Index of descriptor in static descriptor table + * @return String + * @see BobjStore#getLocatorTable() + * @see BobjStore#getIndex(Class) + */ + public String getLocatorTable(int p_i){ return getBobjStoreTable()[p_i].m_sLocTbl; } + + /** + * + */ + protected AbstractBobjStore() {} + + /** + * Constructor using all fields required by a BobjStore object + * @param p_sSnapType String - Snapshot type + * @param p_sSnapTbl String - Snapshot SQL tablename + * @param p_sLocTbl String - Locator SQL tablename (may be null - No locator table) + * @param p_sCls String - Class name excluding package prefix + * @param p_bCrypt boolean - Does data have to be encrypted in the snap table ? + * @see BusinessObject#classNm() + */ + protected AbstractBobjStore (String p_sSnapType,String p_sSnapTbl, String p_sLocTbl + ,String p_sCls, boolean p_bCrypt) + { m_sSnapType = p_sSnapType; + m_sSnapTbl = p_sSnapTbl; + m_sLocTbl = p_sLocTbl; + m_sClass = p_sCls; + m_bEncrypt = p_bCrypt; + } //________________________________ + + /** + * Constructor for non encrypted BobjStore + * @param p_sSnapType String + * @param p_sSnapTbl String + * @param p_sLocTbl String + * @param p_sCls String + * @see BobjStore#BobjStore(String,String,String,String,boolean) + */ + protected AbstractBobjStore (String p_sSnapType,String p_sSnapTbl, String p_sLocTbl + ,String p_sCls) + { this(p_sSnapType,p_sSnapTbl,p_sLocTbl,p_sCls,false); + } //________________________________ + + /** + * Index in static descriptor table for objects of class <arg 1> + * @param p_oCls Class - BusinessObject class to search for in descriptor table + * @throws Exception + * @return int - index in static descriptor table + */ + public int getIndex (Class p_oCls) throws Exception + { String sClassName = p_oCls.getName() + .substring(1+p_oCls.getName().lastIndexOf(".")); + for (int i1 = 0; i1 < getBobjStoreTable().length; i1++) + if (getBobjStoreIndex()[i1].equals(sClassName)) return i1; + throw new Exception("No BobjStore for class "+p_oCls.getName()); + } //__________________________________ + /** + * Get a BobjStore object that describes persistence details for objects of + * class <arg 1> + * @param p_sClassName String Classname to search for in descriptor table + * @return BobjStore - A descriptor that will provide persistence info + * @see PersistHandler + * @see BobjStore#getStore(BusinessObject) + */ + public AbstractBobjStore getStore (String p_sClassName) + { if (null == p_sClassName) return null; + for (int i1 = 0; i1 < getBobjStoreTable().length; i1++) + { String sTblCls = getBobjStoreIndex()[i1]; + if (p_sClassName.equals(sTblCls)) return getStore(i1); + } + return null; + } //__________________________________ + + /** + * Get a BobjStore object that describes persistence details for the + * object specified in arg 1 + * @param p_o BusinessObject The object whose storage descriptor is requested + * @return BobjStore - A descriptor that will provide persistence info + * @see PersistHandler + * @see BobjStore#getStore(String) + */ + public AbstractBobjStore getStore (BaseBusinessObject p_o) + { return (null != p_o) ? getStore(p_o.classNm()) : null; + } //__________________________________ + + /** + * Get a BobjStore object by mnemonic name (index in the static descriptor table) + * @param p_i int - typically a mnemonic name will be used (see CQ3 constants) + * @return BobjStore - A descriptor that will provide persistence info + * @see PersistHandler + * @see BobjStore#getStore(String) + */ + public AbstractBobjStore getStore (int p_i) + { + AbstractBobjStore oRet = getBobjStoreTable()[p_i]; + + try { return (AbstractBobjStore)oRet.clone(); } + catch (Exception e) {return oRet;} + } //________________________________ + +} //____________________________________________________________________________ Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/BobjStore.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/BobjStore.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/BobjStore.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -21,7 +21,7 @@ */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; import java.util.*; Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoBatchTable.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/DaoBatchTable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoBatchTable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -20,7 +20,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; import java.sql.*; import org.apache.log4j.*; Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoIndexTable.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/DaoIndexTable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoIndexTable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -20,7 +20,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; import org.jboss.soa.esb.util.*; import org.jboss.soa.esb.helpers.persist.*; Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoSnapTable.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/DaoSnapTable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoSnapTable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -20,7 +20,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; import org.jboss.soa.esb.util.*; import org.jboss.soa.esb.helpers.persist.*; Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoUidTable.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/DaoUidTable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/DaoUidTable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -21,7 +21,7 @@ */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; import org.jboss.soa.esb.helpers.persist.*; import org.jboss.soa.esb.util.*; Copied: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/ItfStorable.java (from rev 4907, labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/ItfStorable.java) =================================================================== --- labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/ItfStorable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/ItfStorable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -0,0 +1,38 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2006, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + +package org.jboss.soa.esb.internal.core.objectstore; + +/** + * Provides methods to learn about how and where a BusinessObject will be stored + * and retrieved from a BobjStore + * @see BobjStore + */ + +public interface ItfStorable +{ + public String getSnapType (); + public String getSnapTable (); + public String getLocatorTable (); + public String getLocatorTable (int p_i); + public boolean isEncrypted (); +} // ___________________________________________________________________________ Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/RowBatch.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/RowBatch.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/RowBatch.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -20,7 +20,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.jboss.soa.esb.services.dbtables; +package org.jboss.soa.esb.internal.core.objectstore; public class RowBatch { Deleted: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlDbTable.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/SqlDbTable.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlDbTable.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -1,178 +0,0 @@ -/* -* JBoss, Home of Professional Open Source -* Copyright 2006, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - - -package org.jboss.soa.esb.services.dbtables; - -import org.jboss.soa.esb.helpers.persist.*; - -import java.sql.*; - -public abstract class SqlDbTable -{ - protected String m_sTableName; - protected SqlField [] m_oaFields; - - protected PreparedStatement[] m_oaPS; - private JdbcCleanConn m_oConn; - public JdbcCleanConn getConn() { return m_oConn; } - - - public final String getTableName() { return m_sTableName; } - public final SqlField[] getAllFields() { return m_oaFields; } - - private String m_sInsertSql, m_sUpdateSql, m_sDeleteSql; - protected String m_sSelectSql; - - public SqlDbTable(JdbcCleanConn p_oC, String p_sTblNm) throws Exception - { m_oConn = p_oC; - m_sTableName = p_sTblNm; - initFields(); - } //________________________________ - - /** - * Sets values of all columns in underlying table - * - * <p>Developers should use this class's setObject or setLong methods - * @param p_PS PreparedStatement - * @param bobj BusinessObject - * @return the number of fields that were set - * @throws Exception - */ - public abstract int setInsValues(PreparedStatement p_PS,Object bobj) - throws Exception; - public abstract Object getFromRS(ResultSet p_oRS) - throws Exception; - - protected abstract String getSelectFields(); - - public String getFldName(int p_i) - { return (null ==m_oaFields) ? null - : (p_i < 0) ? null - : (p_i >= m_oaFields.length) ? null - : m_oaFields[p_i].getFieldName(); - } //________________________________ - - public String getSelectStatement() - { if ( m_sSelectSql != null ) return m_sSelectSql; - StringBuffer sb=new StringBuffer("select ").append(getSelectFields()); - m_sSelectSql = sb.append(" from ").append(getTableName()).toString(); - return m_sSelectSql; - } //________________________________ - - public String getInsertStatement() - { - if ( m_sInsertSql != null ) return m_sInsertSql; - - StringBuffer sb=new StringBuffer(256); - sb.append("insert into ").append(getTableName()); - - sb.append(" values ("); - for (int i = 0; i <m_oaFields.length; i++) ((i<1)?sb:sb.append(",")).append('?'); - sb.append(')'); - - return (m_sInsertSql = sb.toString()); - } //________________________________ - - public String getUpdateStatement() - { - if ( m_sUpdateSql != null ) return m_sUpdateSql; - - StringBuffer sb=new StringBuffer(256); - sb.append("update ").append(getTableName()).append(" set "); - - StringBuffer sbWhere = new StringBuffer(" where "); - - int iVal = 0; - int iWh = 0; - for (int i = 0; i <m_oaFields.length; i++) - { SqlField oCurr = m_oaFields[i]; - if (oCurr.isPrimaryKey()) - ((iWh++<1)?sbWhere:sbWhere.append(" and ")) - .append(oCurr.getFieldName()).append(" = ?"); - else - ((iVal++<1)?sb:sb.append(",")) - .append(oCurr.getFieldName()).append(" = ?"); - } - sb.append(sbWhere); - - return (m_sUpdateSql = sb.toString()); - } //________________________________ - - public String getDeleteStatement() - { - if ( m_sDeleteSql != null ) return m_sDeleteSql; - - StringBuffer sb=new StringBuffer(256); - sb.append("delete from ").append(getTableName()) - .append(" where "); - - int iWh = 0; - for (int i = 0; i <m_oaFields.length; i++) - { SqlField oCurr = m_oaFields[i]; - if (! oCurr.isPrimaryKey()) continue; - ((iWh++<1)?sb:sb.append(" and ")) - .append(oCurr.getFieldName()).append(" = ?"); - } - - return (m_sDeleteSql = sb.toString()); - } //________________________________ - - public void setObject(PreparedStatement p_PS, int p_iFld, Object p_sFldVal) - throws SQLException - { if (null!=p_sFldVal) - if (p_sFldVal instanceof String) - { String sTr = ((String)p_sFldVal).trim(); - p_sFldVal = (sTr.length()>0) ? sTr : null; - } - ; - int iSqlIdx = 1 + p_iFld; - if (null==p_sFldVal)p_PS.setNull (iSqlIdx, m_oaFields[p_iFld].getSqlType()); - else p_PS.setObject (iSqlIdx, p_sFldVal); - } //________________________________ - - public void setLong(PreparedStatement p_PS, int p_iFld, long p_lVal) - throws SQLException - { p_PS.setLong(1+p_iFld,p_lVal); - } //________________________________ - - public void setInt(PreparedStatement p_PS, int p_iFld, int p_iVal) - throws SQLException - { p_PS.setInt(1+p_iFld,p_iVal); - } //________________________________ - - private void initFields() throws Exception - { PreparedStatement PS = m_oConn.prepareStatement(getSelectStatement()); - - ResultSetMetaData MD = m_oConn.execQueryWait(PS,3).getMetaData(); - m_oaFields = new SqlField[MD.getColumnCount()]; - for (int i1=0; i1<m_oaFields.length;i1++) - { int iCol = 1+i1; - String sFN = MD.getColumnName(iCol); - Class oCL = Class.forName(MD.getColumnClassName(iCol)); - int iTP = MD.getColumnType(iCol); - int iSZ = MD.getColumnDisplaySize(iCol); - m_oaFields[i1] = new SqlField(sFN,oCL,iTP,iSZ,false); - } - PS.close(); - } //________________________________ -} //____________________________________________________________________________ Deleted: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlField.java =================================================================== --- labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/dbtables/SqlField.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/internal/core/objectstore/SqlField.java 2006-07-10 19:08:30 UTC (rev 4978) @@ -1,64 +0,0 @@ -/* -* JBoss, Home of Professional Open Source -* Copyright 2006, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - - -package org.jboss.soa.esb.services.dbtables; - -public class SqlField -{ - private int m_sqlType; - private Class m_javaType; - private int m_sqlLength; - private String m_fieldName; - private boolean m_primaryKey; - - /** - * SqlField - * - * @param pFldName String - * @param pJavaType Class - * @param pSqlType int - * @param pFieldLength int - * @param pk boolean Is primary key ? - */ - public SqlField(String pFldName,Class pJavaType,int pSqlType - ,int pFieldLength, boolean pk) - { - m_fieldName = pFldName; - m_javaType = pJavaType; - m_sqlType = pSqlType; - m_sqlLength = pFieldLength; - m_primaryKey = pk; - } - - public int getSqlType() { return m_sqlType; } - public Class getJavaType() { return m_javaType; } - public int getSqlLength() { return this.m_sqlLength; } - public String getFieldName() { return this.m_fieldName; } - public boolean isPrimaryKey() { return this.m_primaryKey; } - - public void setSqlType(int pSqlType) { m_sqlType = pSqlType; } - public void setJavaType(Class pJavaType) { m_javaType = pJavaType; } - public void setSqlLength(int pSqlLength) { m_sqlLength = pSqlLength; } - public void setFieldName(String pFieldName) { m_fieldName = pFieldName; } - public void setPrimaryKey(boolean pPrimaryKey) { m_primaryKey = pPrimaryKey; } -} //____________________________________________________________________________ |