|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.jinahya.sql.AbstractDbAccessible<I>
I - id type parameterpublic abstract class AbstractDbAccessible<I>
Abstract implementation of DatabaseAccessible.
| Field Summary | |
|---|---|
protected java.lang.String |
idColumnName
id column name. |
protected java.lang.String |
tableName
table name. |
| Constructor Summary | |
|---|---|
AbstractDbAccessible(java.lang.String tableName,
java.lang.String idColumnName,
int idType)
Creates a new instance. |
|
| Method Summary | |
|---|---|
boolean |
delete(java.sql.Connection connection)
Deletes this element. |
protected static java.lang.Byte |
getByte(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads a Byte from given ResultSet. |
protected static byte |
getByte(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
byte defaultValue)
Reads a byte value from given ResultSet. |
protected static java.lang.Double |
getDouble(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads an Float from given ResultSet. |
protected static double |
getDouble(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
float defaultValue)
Reads a double value from given ResultSet. |
protected static java.lang.Float |
getFloat(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads an Float from given ResultSet. |
protected static float |
getFloat(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
float defaultValue)
Reads a float value from given ResultSet. |
I |
getId()
Returns id. |
java.lang.String |
getIdColumnName()
Return id column name. |
int |
getIdType()
Returns the type of id. |
protected static java.lang.Integer |
getInt(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads an Integer from given ResultSet. |
protected static int |
getInt(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
int defaultValue)
Reads an int value from given ResultSet. |
protected static java.lang.Long |
getLong(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads a Long value from given ResultSet. |
protected static long |
getLong(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
long defaultValue)
Reads a long value from given ResultSet. |
protected static java.lang.Short |
getShort(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Reads a Short value from given ResultSet mapped to specified columnLabel. |
protected static short |
getShort(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
short defaultValue)
Reads a short value from given resultSet. |
java.lang.String |
getTableName()
Returns table name. |
protected static java.util.Date |
getTimestamp(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
Retrieves the value of the designated column in the current row of specified resultSet object as a java.util.Date
object in the Java programming language. |
protected static java.util.Date |
getTimestamp(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
java.util.Calendar cal)
|
void |
read(java.sql.ResultSet resultSet)
Reads information from given resultSet. |
boolean |
select(java.sql.Connection connection)
Selects this instance. |
void |
setId(I id)
Sets id. |
protected static void |
setTimestamp(java.sql.CallableStatement callableStatement,
int parameterIndex,
java.util.Date value)
|
protected static void |
setTimestamp(java.sql.CallableStatement callableStatement,
int parameterIndex,
java.lang.Long value)
|
protected static void |
setTimestamp(java.sql.PreparedStatement preparedStatement,
int parameterIndex,
java.util.Date value)
|
protected static void |
setTimestamp(java.sql.PreparedStatement preparedStatement,
int parameterIndex,
java.lang.Long value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.googlecode.jinahya.sql.DbAccessible |
|---|
insert, read, update |
| Field Detail |
|---|
protected final java.lang.String tableName
protected final java.lang.String idColumnName
| Constructor Detail |
|---|
public AbstractDbAccessible(java.lang.String tableName,
java.lang.String idColumnName,
int idType)
tableName - table nameidColumnName - id column nameidType - id type| Method Detail |
|---|
protected static java.lang.Byte getByte(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column label
null if the column value is
null
java.sql.SQLException - if an SQL error occurs.
protected static byte getByte(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
byte defaultValue)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column labeldefaultValue - default value
defalutValue if the column
value is null
java.sql.SQLException - if an SQL error occurs.
protected static java.lang.Short getShort(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
columnLabel.
resultSet - result setcolumnLabel - column label
null if the column value is
null.
java.sql.SQLException - if an SQL error occurs.
protected static short getShort(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
short defaultValue)
throws java.sql.SQLException
resultSet.
resultSet - result setcolumnLabel - column labeldefaultValue - default value
defalutValue if the column
value is null.
java.sql.SQLException - if an SQL error occurs.
protected static java.lang.Integer getInt(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column label
java.sql.SQLException - if an SQL error occurs.
protected static int getInt(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
int defaultValue)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column labeldefaultValue - default value
java.sql.SQLException - if an SQL error occurs.
protected static java.lang.Long getLong(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column label
java.sql.SQLException - if an SQL error occurs.
protected static long getLong(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
long defaultValue)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column labeldefaultValue - default value
java.sql.SQLException - if an SQL error occurs.
protected static java.lang.Float getFloat(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column label
null if database value is null
java.sql.SQLException - if an SQL error occurs.
protected static float getFloat(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
float defaultValue)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column labeldefaultValue - default value
defalutValue if database value
is null
java.sql.SQLException - if an SQL error occurs.
protected static java.lang.Double getDouble(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column label
null if database value is null
java.sql.SQLException - if an SQL error occurs.
protected static double getDouble(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
float defaultValue)
throws java.sql.SQLException
resultSet - result setcolumnLabel - column labeldefaultValue - default value
defalutValue if database value
is null
java.sql.SQLException - if an SQL error occurs.
protected static java.util.Date getTimestamp(java.sql.ResultSet resultSet,
java.lang.String columnLabel)
throws java.sql.SQLException
resultSet object as a java.util.Date
object in the Java programming language.
resultSet - resultSetcolumnLabel - the label for the column specified with the SQL AS
clause. If the SQL AS clause was not specified, then the label is
the name of the column
NULL, the
value returned is null
java.sql.SQLException - if the columnLabel is not valid; if a database
access error occurs or this method is called on a closed result
set
protected static java.util.Date getTimestamp(java.sql.ResultSet resultSet,
java.lang.String columnLabel,
java.util.Calendar cal)
throws java.sql.SQLException
java.sql.SQLException
protected static void setTimestamp(java.sql.CallableStatement callableStatement,
int parameterIndex,
java.lang.Long value)
throws java.sql.SQLException
java.sql.SQLException
protected static void setTimestamp(java.sql.PreparedStatement preparedStatement,
int parameterIndex,
java.lang.Long value)
throws java.sql.SQLException
java.sql.SQLException
protected static void setTimestamp(java.sql.CallableStatement callableStatement,
int parameterIndex,
java.util.Date value)
throws java.sql.SQLException
java.sql.SQLException
protected static void setTimestamp(java.sql.PreparedStatement preparedStatement,
int parameterIndex,
java.util.Date value)
throws java.sql.SQLException
java.sql.SQLExceptionpublic I getId()
DbAccessible
getId in interface DbAccessible<I>public void setId(I id)
DbAccessible
setId in interface DbAccessible<I>id - idpublic final int getIdType()
DbAccessible
getIdType in interface DbAccessible<I>public final java.lang.String getTableName()
DbAccessible
getTableName in interface DbAccessible<I>public final java.lang.String getIdColumnName()
DbAccessible
getIdColumnName in interface DbAccessible<I>
public boolean select(java.sql.Connection connection)
throws java.sql.SQLException
DbAccessible
select in interface DbAccessible<I>connection - connection
java.sql.SQLException - if an SQL error occurs.
public boolean delete(java.sql.Connection connection)
throws java.sql.SQLException
DbAccessible
delete in interface DbAccessible<I>connection - connection
java.sql.SQLException - if an SQL error occurs.
public void read(java.sql.ResultSet resultSet)
throws java.sql.SQLException
DbAccessibleresultSet.
read in interface DbAccessible<I>resultSet - result set
java.sql.SQLException - if an SQL error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||