org.vizzini.database
Interface IRecord

All Superinterfaces:
Cloneable, Comparable, IGenericData
All Known Implementing Classes:
Record

public interface IRecord
extends IGenericData

Provides a generic data object which can be stored in a database.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
static Integer INVALID_ID
           
 
Method Summary
 void associate(IRecord another)
          Associate this to the given record using a join known to the database.
 Object clone()
          Clone this object.
 int compareTo(Object another)
          Compare this to the given object.
 void delete()
          Delete this object from the database.
 void disassociate(IRecord another)
          Diassociate this from the given object.
 String getAsDBString(String propertyName)
          Return the property value for the given property name, formatted as a database string.
 List getAssociated()
          Return objects of all tables which are associated to this object.
 List getAssociated(ITableData tableData)
          Return objects of the given table which are associated to this object.
 List getAssociated(String tableName)
          Return objects of the given table which are associated to this object.
 IDatabase getDatabase()
          Return the database.
 int getId()
          Return the object ID.
 Iterator getJoins()
          Return an iterator over IAssociation s which involve this object's table.
 Iterator getJunctions()
          Return an iterator over IAssociation s which involve this object's table.
 ITableData getTableData()
          Return the table data.
 String getTableName()
          Return the table name.
 void insert()
          Insert this object into the database.
 void reload()
          Reload this object from the database.
 void set(String propertyName, Class type, Object value)
          Set the value of the named property.
 String toDebugString()
          Return a string representation of this object.
 String toString()
          Return a string representation of this object.
 String toXMLString()
          Return an XML string representation of this object.
 void update()
          Update this object in the database.
 
Methods inherited from interface org.vizzini.util.IGenericData
clear, copy, equals, get, getPropertyNames, getType, hashCode, set, set, set, set, set, set
 

Field Detail

INVALID_ID

static final Integer INVALID_ID
Method Detail

associate

void associate(IRecord another)
               throws SQLException
Associate this to the given record using a join known to the database.

Throws:
SQLException
Since:
v0.3

clone

Object clone()
Clone this object.

Specified by:
clone in interface IGenericData
Since:
v0.3

compareTo

int compareTo(Object another)
Compare this to the given object.

Specified by:
compareTo in interface Comparable
Specified by:
compareTo in interface IGenericData
Returns:
-1, 0, +1 if this is less than, equal to, or greater than
Since:
v0.3

delete

void delete()
            throws SQLException
Delete this object from the database.

Throws:
SQLException
Since:
v0.3

disassociate

void disassociate(IRecord another)
                  throws SQLException
Diassociate this from the given object.

Throws:
SQLException
Since:
v0.3

getAsDBString

String getAsDBString(String propertyName)
Return the property value for the given property name, formatted as a database string.

Since:
v0.3

getAssociated

List getAssociated()
                   throws SQLException
Return objects of all tables which are associated to this object.

Throws:
SQLException
Since:
v0.3

getAssociated

List getAssociated(String tableName)
                   throws SQLException
Return objects of the given table which are associated to this object.

Throws:
SQLException
Since:
v0.3

getAssociated

List getAssociated(ITableData tableData)
                   throws SQLException
Return objects of the given table which are associated to this object.

Throws:
SQLException
Since:
v0.3

getDatabase

IDatabase getDatabase()
Return the database.

Since:
v0.3

getId

int getId()
Return the object ID.

Since:
v0.3

getJoins

Iterator getJoins()
Return an iterator over IAssociation s which involve this object's table.

Since:
v0.3

getJunctions

Iterator getJunctions()
Return an iterator over IAssociation s which involve this object's table.

Since:
v0.3

getTableData

ITableData getTableData()
Return the table data.

Since:
v0.3

getTableName

String getTableName()
Return the table name.

Since:
v0.3

insert

void insert()
            throws SQLException
Insert this object into the database.

Throws:
SQLException
Since:
v0.3

reload

void reload()
            throws SQLException
Reload this object from the database.

Throws:
SQLException
Since:
v0.3

set

void set(String propertyName,
         Class type,
         Object value)
Set the value of the named property. Overrides the super method to convert the property name to uppercase.

Specified by:
set in interface IGenericData
Since:
v0.3

toDebugString

String toDebugString()
Return a string representation of this object.

Since:
v0.3

toString

String toString()
Return a string representation of this object.

Specified by:
toString in interface IGenericData
Overrides:
toString in class Object
Since:
v0.3

toXMLString

String toXMLString()
Return an XML string representation of this object.

Since:
v0.3

update

void update()
            throws SQLException
Update this object in the database.

Throws:
SQLException
Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02