|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.appserver.server.sql.CoreDO
Base class from which the data objects are derived.
Field Summary | |
protected boolean |
persistent
|
static boolean |
versioning
|
Constructor Summary | |
CoreDO()
Public constructor. |
|
CoreDO(java.sql.ResultSet rs)
Public constructor. |
Method Summary | |
void |
addToCache()
This method is invoked whenever an object is added to the cache. |
void |
deleteFromCache()
This method is invoked whenever an object is deleted from the cache. |
static void |
disableVersioning()
Disable use of the version column. |
void |
evict()
This method is invoked whenever an object is removed from the cache. |
void |
executeDelete(DBConnection conn)
Deletes this object from the database. |
void |
executeInsert(DBConnection conn)
Inserts this object into the database. |
void |
executeUpdate(DBConnection conn)
Updates the contents of this object in the database. |
void |
finalizeDelete(boolean success)
Currently does nothing. |
void |
finalizeInsert(boolean success)
Updates the persistent state. |
void |
finalizeUpdate(boolean success)
The version number of this object is set to the next version for this object if this object was successfully updated in the database. |
abstract java.sql.PreparedStatement |
getDeleteStatement(DBConnection conn)
Returns the statement that can be used to delete this object from the database. |
abstract java.sql.PreparedStatement |
getInsertStatement(DBConnection conn)
Returns the statement that can be used to insert this object into the database. |
protected int |
getNewVersion()
Returns this object's new version. |
ObjectId |
getOId()
Returns this object's identifier. |
static java.lang.String |
getOIdColumnName()
Returns the object identifier column name. |
protected java.lang.String |
getTableName()
Return the name of the table whose rows represent these objects. |
abstract java.sql.PreparedStatement |
getUpdateStatement(DBConnection conn)
Returns the statement that can be used to update this object in the database. |
protected int |
getVersion()
Returns this object's version. |
static java.lang.String |
getVersionColumnName()
Returns the version column name. |
boolean |
isPersistent()
Returns true if this object is persistent in the database (i.e. |
void |
refresh()
This method is invoked whenever object's data needs to be loaded. |
protected void |
setNewVersion(int newVersion)
Sets this object's new version number. |
protected void |
setOId(ObjectId oId)
Sets this object's identifier. |
static void |
setOIdColumnName(java.lang.String _oidColumnName)
Sets the object identifier column name. |
void |
setPersistent(boolean persistent)
Sets the persistent state for this object. |
protected void |
setVersion(int version)
Sets this object's version. |
static void |
setVersionColumnName(java.lang.String _versionColumnName)
Sets the version column name. |
void |
updateCache()
This method is invoked whenever an object is inserted or updated in the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean versioning
protected boolean persistent
Constructor Detail |
public CoreDO()
public CoreDO(java.sql.ResultSet rs) throws java.sql.SQLException, ObjectIdException
rs
- a result set.
java.sql.SQLException
- if an error occurs while instantiating this
object from the result set.
ObjectIdException
- if the object id for this object is
invalid.Method Detail |
public static void disableVersioning()
public static java.lang.String getOIdColumnName()
public static void setOIdColumnName(java.lang.String _oidColumnName)
public static java.lang.String getVersionColumnName()
public static void setVersionColumnName(java.lang.String _versionColumnName)
public ObjectId getOId()
protected void setOId(ObjectId oId)
oId
- this object's identifier.protected void setVersion(int version)
version
- the object's version.protected int getVersion()
protected void setNewVersion(int newVersion)
newVersion
- this object's next version.protected int getNewVersion()
public boolean isPersistent()
public void setPersistent(boolean persistent)
persistent
- true if this object is present in
persistent store.public abstract java.sql.PreparedStatement getInsertStatement(DBConnection conn) throws java.sql.SQLException
conn
- the database connection.
java.sql.SQLException
- If an error occurs.public abstract java.sql.PreparedStatement getUpdateStatement(DBConnection conn) throws java.sql.SQLException
conn
- the database connection.
java.sql.SQLException
- If an error occurs.public abstract java.sql.PreparedStatement getDeleteStatement(DBConnection conn) throws java.sql.SQLException
conn
- the database connection.
java.sql.SQLException
- If an error occurs.public void executeInsert(DBConnection conn) throws java.sql.SQLException, DBRowUpdateException
executeInsert
in interface Transaction
conn
- the database connection.
java.sql.SQLException
- if a database access error occurs.
DBRowUpdateException
- If a version error occurs.public void finalizeInsert(boolean success)
finalizeInsert
in interface Transaction
success
- true if the transaction succeeded
and this object was successfully inserted into the database.public void executeUpdate(DBConnection conn) throws java.sql.SQLException, DBRowUpdateException
executeUpdate
in interface Transaction
conn
- the database connection.
java.sql.SQLException
- If a database access error occurs.
DBRowUpdateException
- If a version error occurs.protected java.lang.String getTableName()
executeUpdate(com.lutris.appserver.server.sql.DBConnection)
public void finalizeUpdate(boolean success)
finalizeUpdate
in interface Transaction
success
- true if the transaction succeeded
and this object was successfully updated in the database.getNewVersion()
public void executeDelete(DBConnection conn) throws java.sql.SQLException
executeDelete
in interface Transaction
conn
- Database connection.
java.sql.SQLException
- If a database access error
occurs.public void finalizeDelete(boolean success)
finalizeDelete
in interface Transaction
success
- true if the transaction succeeded
and this object was successfully deleted from the
database.public void updateCache()
public void deleteFromCache()
public void addToCache()
public void evict()
public void refresh() throws DataObjectException
DataObjectException
- If a data access error occurs.
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |