public interface DatabaseObject
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete the object from the database, using its table name from the meta data and row ID.
|
TableMetaData |
getTableMetaData()
Get the
TableMetaData for this object. |
void |
insert()
Insert the data of this object into the database.
|
boolean |
isNew()
Return
true if the record |
boolean |
select(int id)
Select information from the database into this object using the row ID.
|
void |
setConnection(Connection connection)
Set the database
Connection for the object. |
void |
setTableMetaData(TableMetaData tableMetaData)
Set the table meta data of the object.
|
boolean |
update()
Update the information in the database from this object.
|
void delete() throws DatabaseObjectException, SQLException
ConditionsObjectException
- if there was an error deleting the objectSQLException
- if there was a SQL query errorDatabaseObjectException
TableMetaData getTableMetaData()
TableMetaData
for this object.TableMetaData
for this object.void insert() throws DatabaseObjectException, SQLException
This could be a single object or a collection of objects depending on the implementation.
boolean isNew()
true
if the recordtrue
if the object is newboolean select(int id) throws DatabaseObjectException, SQLException
id
- the row IDtrue
if the select operation workedDatabaseObjectException
- if there was an error selecting information into this objectSQLException
- if there was a query errorvoid setConnection(Connection connection)
Connection
for the object.connection
- the database Connection
for the objectvoid setTableMetaData(TableMetaData tableMetaData)
tableMetaData
- the table meta data of the objectTableMetaData
boolean update() throws DatabaseObjectException, SQLException
true
if an update occurredConditionsObjectException
- if there is an error performing the update from the objectSQLException
- if there is a SQL query errorDatabaseObjectException
Copyright © 2019. All rights reserved.