| java.lang.Object com.workingdogs.village.Record
Record | public class Record (Code) | | A Record represents a row in the database. It contains a collection of Values which are the individual
contents of each column in the row.
author: Jon S. Stevens version: $Revision: 568 $ |
Constructor Summary | |
public | Record() This isn't used and doesn't do anything. | public | Record(DataSet ds) Creates a new Record and sets the parent dataset to the passed in value. | | Record(DataSet ds, boolean addRecord) This is a special case method for Record. |
Method Summary | |
public String | asFormattedString(String valueseparator, int[] maxwidths) return the value of each column as a string. | public DataSet | dataset() | public String | getRefreshQueryString() This builds the SELECT statement in order to refresh the contents of this Record. | public String | getSaveString() Gets the appropriate SQL string for this record. | int | getSaveType() | public Value | getValue(int i) | public Value | getValue(String columnName) | public boolean | isAZombie() Determines if this record is a Zombie. | public void | markForInsert() Marks this record to be inserted when a save is executed. | public void | markForUpdate() Marks this record to be updated when a save is executed. | public void | markRecordClean() Marks all the values in this record as clean. | public Record | markToBeDeleted() Marks this record to be deleted when a save is executed. | public void | markValueClean(int pos) marks a value at a given position as clean. | public void | markValueClean(String columnName) marks a value with a given column name as clean. | public void | markValueDirty(int pos) marks a value at a given position as dirty. | public void | markValueDirty(String columnName) marks a value with a given column name as dirty. | public boolean | needsToBeSaved() If the record is not clean, needs to be saved with an Update, Delete or Insert, it returns true. | public boolean | recordIsClean() Goes through all the values in the record to determine if it is clean or not. | public void | refresh(Connection connection) This method refreshes this Record's Value's. | public int | save() Saves the data in this Record to the database. | public int | save(Connection connection) Saves the data in this Record to the database. | public void | saveWithoutStatusUpdate() | public Schema | schema() | void | setParentDataSet(DataSet ds) Sets the parent DataSet for this record. | void | setSaveType(int type) | public Record | setValue(int pos, BigDecimal value) | public Record | setValue(int pos, boolean value) | public Record | setValue(int pos, byte[] value) | public Record | setValue(int pos, java.util.Date value) | public Record | setValue(int pos, java.sql.Date value) | public Record | setValue(int pos, double value) | public Record | setValue(int pos, float value) | public Record | setValue(int pos, int value) | public Record | setValue(int pos, long value) | public Record | setValue(int pos, String value) | public Record | setValue(int pos, java.sql.Time value) | public Record | setValue(int pos, java.sql.Timestamp value) | public Record | setValue(int pos, Value value) | public Record | setValue(String columnName, BigDecimal value) | public Record | setValue(String columnName, boolean value) | public Record | setValue(String columnName, byte[] value) | public Record | setValue(String columnName, java.util.Date value) | public Record | setValue(String columnName, java.sql.Date value) | public Record | setValue(String columnName, double value) | public Record | setValue(String columnName, float value) | public Record | setValue(String columnName, int value) | public Record | setValue(String columnName, long value) | public Record | setValue(String columnName, String value) | public Record | setValue(String columnName, java.sql.Time value) | public Record | setValue(String columnName, java.sql.Timestamp value) | public Record | setValue(String columnName, Value value) | public Record | setValueNull(int pos) | public Record | setValueNull(String columnName) | public int | size() | public boolean | toBeSavedWithDelete() | public boolean | toBeSavedWithInsert() | public boolean | toBeSavedWithUpdate() | public String | toString() | public Record | unmarkToBeDeleted() Unmarks a record that has been marked for deletion. | public boolean | valueIsClean(int i) Determines whether or not a value stored in the record is clean. | boolean | valueIsClean(String column) Determines whether or not a value stored in the record is clean. |
Record | public Record()(Code) | | This isn't used and doesn't do anything.
|
Record | public Record(DataSet ds) throws DataSetException, SQLException(Code) | | Creates a new Record and sets the parent dataset to the passed in value. This method also creates the Value objects which
are associated with this Record.
Parameters: ds - TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! throws: SQLException - TODO: DOCUMENT ME! |
Record | Record(DataSet ds, boolean addRecord) throws DataSetException, SQLException(Code) | | This is a special case method for Record. This case is really only used when DataSet.addRecord() is called because we may
not have an existing ResultSet so there will not be any values in the Value objects that are created. Passing null to
createValues forces the Value object to be created, but no processing to be done within the Value object constructor.
This method is a package method only because it is really not useful outside of the package.
Parameters: ds - the dataset Parameters: addRecord - whether or not this method is being called from DataSet.addRecord() throws: DataSetException - TODO: DOCUMENT ME! throws: SQLException - TODO: DOCUMENT ME! |
asFormattedString | public String asFormattedString(String valueseparator, int[] maxwidths) throws DataSetException(Code) | | return the value of each column as a string. Not yet implemented!
Parameters: valueseparator - Parameters: maxwidths - the formatted string exception: DataSetException - |
dataset | public DataSet dataset()(Code) | | Gets the DataSet for this Record
the DataSet for this Record |
getRefreshQueryString | public String getRefreshQueryString() throws DataSetException(Code) | | This builds the SELECT statement in order to refresh the contents of this Record. It depends on a valid KeyDef to exist and
it must have been created with a TableDataSet.
the SELECT string exception: DataSetException - |
getSaveType | int getSaveType()(Code) | | gets the internal save type as one of the defined privates (ie: ZOMBIE)
TODO: DOCUMENT ME! |
isAZombie | public boolean isAZombie()(Code) | | Determines if this record is a Zombie. A Zombie is a record that has been deleted from the database, but not yet removed
from the DataSet.
a boolean |
markValueClean | public void markValueClean(int pos) throws DataSetException(Code) | | marks a value at a given position as clean.
Parameters: pos - TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
markValueClean | public void markValueClean(String columnName) throws DataSetException(Code) | | marks a value with a given column name as clean.
Parameters: columnName - TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
markValueDirty | public void markValueDirty(int pos) throws DataSetException(Code) | | marks a value at a given position as dirty.
Parameters: pos - TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
markValueDirty | public void markValueDirty(String columnName) throws DataSetException(Code) | | marks a value with a given column name as dirty.
Parameters: columnName - TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
needsToBeSaved | public boolean needsToBeSaved()(Code) | | If the record is not clean, needs to be saved with an Update, Delete or Insert, it returns true.
boolean |
recordIsClean | public boolean recordIsClean()(Code) | | Goes through all the values in the record to determine if it is clean or not.
true if clean |
setParentDataSet | void setParentDataSet(DataSet ds)(Code) | | Sets the parent DataSet for this record.
Parameters: ds - TODO: DOCUMENT ME! |
setSaveType | void setSaveType(int type)(Code) | | sets the internal save type as one of the defined privates (ie: ZOMBIE)
Parameters: type - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, boolean value) throws DataSetException(Code) | | sets the value at pos with a boolean
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, byte[] value) throws DataSetException(Code) | | sets the value at pos with a byte[]
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, double value) throws DataSetException(Code) | | sets the value at pos with a double
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, float value) throws DataSetException(Code) | | sets the value at pos with a float
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, int value) throws DataSetException(Code) | | sets the value at pos with a int
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, long value) throws DataSetException(Code) | | sets the value at pos with a long
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, String value) throws DataSetException(Code) | | sets the value at pos with a String
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(int pos, Value value) throws DataSetException(Code) | | sets the value at pos with a Value
Parameters: pos - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, boolean value) throws DataSetException(Code) | | sets the value at column name with a boolean
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, byte[] value) throws DataSetException(Code) | | sets the value at column name with a byte[]
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, double value) throws DataSetException(Code) | | sets the value at column name with a double
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, float value) throws DataSetException(Code) | | sets the value at column name with a float
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, int value) throws DataSetException(Code) | | sets the value at column name with a int
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, long value) throws DataSetException(Code) | | sets the value at column name with a long
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, String value) throws DataSetException(Code) | | sets the value at column name with a String
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
setValue | public Record setValue(String columnName, Value value) throws DataSetException(Code) | | sets the value at column name with a Value
Parameters: columnName - TODO: DOCUMENT ME! Parameters: value - TODO: DOCUMENT ME! TODO: DOCUMENT ME! throws: DataSetException - TODO: DOCUMENT ME! |
size | public int size()(Code) | | the number of columns in this object
the number of columns in this object |
toBeSavedWithDelete | public boolean toBeSavedWithDelete()(Code) | | whether or not this Record is to be saved with an SQL delete statement
true if saved with delete |
toBeSavedWithInsert | public boolean toBeSavedWithInsert()(Code) | | whether or not this Record is to be saved with an SQL insert statement
true if saved with insert |
toBeSavedWithUpdate | public boolean toBeSavedWithUpdate()(Code) | | whether or not this Record is to be saved with an SQL update statement
true if saved with update |
toString | public String toString()(Code) | | This returns a representation of this Record
java.lang.String |
valueIsClean | public boolean valueIsClean(int i)(Code) | | Determines whether or not a value stored in the record is clean.
Parameters: i - TODO: DOCUMENT ME! true if clean |
valueIsClean | boolean valueIsClean(String column) throws DataSetException(Code) | | Determines whether or not a value stored in the record is clean.
Parameters: column - TODO: DOCUMENT ME! true if clean throws: DataSetException - TODO: DOCUMENT ME! |
|
|