com.googlecode.jinahya.sql
Interface DbAccessible<I>

Type Parameters:
I - id type parameter
All Superinterfaces:
com.googlecode.jinahya.util.Accessible
All Known Implementing Classes:
AbstractDbAccessible, DbAccessibleWithLong, DbAccessibleWithString

public interface DbAccessible<I>
extends com.googlecode.jinahya.util.Accessible

Interface for database mapped elements.

Author:
Jin Kwon

Method Summary
 boolean delete(java.sql.Connection connection)
          Deletes this element.
 I getId()
          Returns id.
 java.lang.String getIdColumnName()
          Return id column name.
 int getIdType()
          Returns the type of id.
 java.lang.String getTableName()
          Returns table name.
 boolean insert(java.sql.Connection connection)
          Inserts this element.
 void read(java.sql.ResultSet resultSet)
          Reads information from given resultSet.
 void read(java.sql.ResultSet resultSet, java.lang.String columnLabelPrefix)
          Reads information from given resultSet.
 boolean select(java.sql.Connection connection)
          Selects this instance.
 void setId(I id)
          Sets id.
 boolean update(java.sql.Connection connection)
          Updates this instance.
 

Method Detail

getId

I getId()
Returns id.

Returns:
id

setId

void setId(I id)
Sets id.

Parameters:
id - id

getIdType

int getIdType()
Returns the type of id.

Returns:
id type

getTableName

java.lang.String getTableName()
Returns table name.

Returns:
table name

getIdColumnName

java.lang.String getIdColumnName()
Return id column name.

Returns:
id column name.

delete

boolean delete(java.sql.Connection connection)
               throws java.sql.SQLException
Deletes this element.

Parameters:
connection - connection
Returns:
true if successfully deleted; false otherwise.
Throws:
java.sql.SQLException - if an SQL error occurs.

insert

boolean insert(java.sql.Connection connection)
               throws java.sql.SQLException
Inserts this element.

Parameters:
connection - connection
Returns:
true if successfully inserted; false otherwise.
Throws:
java.sql.SQLException - if an SQL error occurs.

select

boolean select(java.sql.Connection connection)
               throws java.sql.SQLException
Selects this instance.

Parameters:
connection - connection
Returns:
true if successfully selected; false otherwise.
Throws:
java.sql.SQLException - if an SQL error occurs.

update

boolean update(java.sql.Connection connection)
               throws java.sql.SQLException
Updates this instance.

Parameters:
connection - connection
Returns:
true if successfully updated; false otherwise.
Throws:
java.sql.SQLException - if an SQL error occurs.

read

void read(java.sql.ResultSet resultSet)
          throws java.sql.SQLException
Reads information from given resultSet.

Parameters:
resultSet - result set
Throws:
java.sql.SQLException - if an SQL error occurs.

read

void read(java.sql.ResultSet resultSet,
          java.lang.String columnLabelPrefix)
          throws java.sql.SQLException
Reads information from given resultSet.

Parameters:
resultSet - result set
columnLabelPrefix - column label prefix
Throws:
java.sql.SQLException - if an SQL error occurs.


Copyright © 2011. All Rights Reserved.