|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.youyounet.db.Column
Column is a help class that encapsulate the information needed to map a Data Bean's property to a database table column.
Field Summary | |
protected java.lang.reflect.Field |
beanProperty
|
protected ColumnAttribute |
columnAttribute
|
protected int |
columnType
|
Constructor Summary | |
Column(java.lang.reflect.Field beanProperty,
ColumnAttribute columnAttribute)
public constructor |
Method Summary | |
java.lang.reflect.Field |
getBeanProperty()
Get the value of bean Property. |
ColumnAttribute |
getColumnAttribute()
Get the value of ColumnAttribute |
int |
getColumnAttributeValue()
Get the attributeValue of the columnAttribute |
java.lang.String |
getColumnName()
Get the database table column name |
int |
getColumnType()
Get the value of columnType |
static int |
getColumnType(java.lang.String c)
A static method that takes a Java type name as parameter and returns the corresponding interger value defined in class DataType |
protected boolean |
loadProperty(java.sql.ResultSet result,
java.lang.Object obj)
Set the obj's property corresponding to this column to the specified ResultSet's value. |
protected boolean |
loadProperty(java.sql.ResultSet result,
java.lang.Object obj,
int index)
Set the obj's property corresponding to this column to the specified ResultSet's value. |
static void |
setPSVariable(java.sql.PreparedStatement pstmt,
java.lang.Object obj,
int index)
Set a PreparedStatement's value corresponding to this column to the specified obj's property value |
static void |
setPSVariableNull(java.sql.PreparedStatement pstmt,
int sqlType,
int index)
Set a PreparedStatement's value corresponding to this column to null |
protected void |
setVariable(java.sql.PreparedStatement pstmt,
java.lang.Object obj,
int index)
Set a PreparedStatement's value corresponding to this column to the specified obj's property value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.reflect.Field beanProperty
protected ColumnAttribute columnAttribute
protected int columnType
Constructor Detail |
public Column(java.lang.reflect.Field beanProperty, ColumnAttribute columnAttribute)
beanProperty
- java.lang.reflect.Field typed bean property used to map
to this columncolumnAttribute
- a parameter of type ColumnAttribute
Method Detail |
public static int getColumnType(java.lang.String c)
DataType
c
- Java data type name
public java.lang.reflect.Field getBeanProperty()
public ColumnAttribute getColumnAttribute()
public int getColumnType()
public java.lang.String getColumnName()
public int getColumnAttributeValue()
ColumnAttribute
public static void setPSVariableNull(java.sql.PreparedStatement pstmt, int sqlType, int index) throws java.sql.SQLException
pstmt
- the PreparedStatement object for which this column's value will
be set to nullsqlType
- int value corresponding to the Java SQL type of this columnindex
- index of this column in the database table
java.sql.SQLException
public static void setPSVariable(java.sql.PreparedStatement pstmt, java.lang.Object obj, int index) throws java.sql.SQLException, DataTransferException
pstmt
- the PreparedStatement object for which this column's value will
be set to the specified obj's corresponding property valueindex
- index of this column in the database tableobj
- whose corresponding property value will be used to set the value
of the PreparedStatement object
java.sql.SQLException
{@link
- DataTransferException}
DataTransferException
protected void setVariable(java.sql.PreparedStatement pstmt, java.lang.Object obj, int index) throws java.sql.SQLException, DataTransferException
pstmt
- the PreparedStatement object for which this column's value will
be set to the specified obj's corresponding property valueindex
- index of this column in the database tableobj
- whose corresponding property value will be used to set the value
of the PreparedStatement object
java.sql.SQLException
{@link
- DataTransferException}
DataTransferException
protected boolean loadProperty(java.sql.ResultSet result, java.lang.Object obj) throws java.sql.SQLException, DataTransferException
result
- the ResultSet object whose value corresponding to this column will
be used to set the specified obj's corresponding property valueobj
- whose property value corresponding to this column will be set using
the passed in ResultSet object
java.sql.SQLException
{@link
- DataTransferException}
DataTransferException
protected boolean loadProperty(java.sql.ResultSet result, java.lang.Object obj, int index) throws java.sql.SQLException, DataTransferException
result
- the ResultSet object whose value corresponding to this column will
be used to set the specified obj's corresponding property valueobj
- whose property value corresponding to this column will be set using
the passed in ResultSet objectindex
- the index of this column in the table
java.sql.SQLException
{@link
- DataTransferException}
DataTransferException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |