|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.workingdogs.village.Record
public class Record
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.
Constructor Summary | |
---|---|
Record()
This isn't used and doesn't do anything. |
|
Record(DataSet ds)
Creates a new Record and sets the parent dataset to the passed in value. |
Method Summary | |
---|---|
java.lang.String |
asFormattedString(java.lang.String valueseparator,
int[] maxwidths)
return the value of each column as a string. |
DataSet |
dataset()
Gets the DataSet for this Record |
java.lang.String |
getRefreshQueryString()
This builds the SELECT statement in order to refresh the contents of this Record. |
java.lang.String |
getSaveString()
Gets the appropriate SQL string for this record. |
Value |
getValue(int i)
gets the value at index i |
Value |
getValue(java.lang.String columnName)
TODO: DOCUMENT ME! |
boolean |
isAZombie()
Determines if this record is a Zombie. |
void |
markForInsert()
Marks this record to be inserted when a save is executed. |
void |
markForUpdate()
Marks this record to be updated when a save is executed. |
void |
markRecordClean()
Marks all the values in this record as clean. |
Record |
markToBeDeleted()
Marks this record to be deleted when a save is executed. |
void |
markValueClean(int pos)
marks a value at a given position as clean. |
void |
markValueClean(java.lang.String columnName)
marks a value with a given column name as clean. |
void |
markValueDirty(int pos)
marks a value at a given position as dirty. |
void |
markValueDirty(java.lang.String columnName)
marks a value with a given column name as dirty. |
boolean |
needsToBeSaved()
If the record is not clean, needs to be saved with an Update, Delete or Insert, it returns true. |
boolean |
recordIsClean()
Goes through all the values in the record to determine if it is clean or not. |
void |
refresh(java.sql.Connection connection)
This method refreshes this Record's Value's. |
int |
save()
Saves the data in this Record to the database. |
int |
save(java.sql.Connection connection)
Saves the data in this Record to the database. |
void |
saveWithoutStatusUpdate()
TODO: DOCUMENT ME! |
Schema |
schema()
Gets the schema for the parent DataSet |
Record |
setValue(int pos,
java.math.BigDecimal value)
sets the value at pos with a BigDecimal |
Record |
setValue(int pos,
boolean value)
sets the value at pos with a boolean |
Record |
setValue(int pos,
byte[] value)
sets the value at pos with a byte[] |
Record |
setValue(int pos,
java.util.Date value)
sets the value at pos with a java.util.Date |
Record |
setValue(int pos,
java.sql.Date value)
sets the value at pos with a java.sql.Date |
Record |
setValue(int pos,
double value)
sets the value at pos with a double |
Record |
setValue(int pos,
float value)
sets the value at pos with a float |
Record |
setValue(int pos,
int value)
sets the value at pos with a int |
Record |
setValue(int pos,
long value)
sets the value at pos with a long |
Record |
setValue(int pos,
java.lang.String value)
sets the value at pos with a String |
Record |
setValue(int pos,
java.sql.Time value)
sets the value at pos with a java.sql.Time |
Record |
setValue(int pos,
java.sql.Timestamp value)
sets the value at pos with a java.sql.Timestamp |
Record |
setValue(int pos,
Value value)
sets the value at pos with a Value |
Record |
setValue(java.lang.String columnName,
java.math.BigDecimal value)
sets the value at column name with a BigDecimal |
Record |
setValue(java.lang.String columnName,
boolean value)
sets the value at column name with a boolean |
Record |
setValue(java.lang.String columnName,
byte[] value)
sets the value at column name with a byte[] |
Record |
setValue(java.lang.String columnName,
java.util.Date value)
sets the value at column name with a java.util.Date |
Record |
setValue(java.lang.String columnName,
java.sql.Date value)
sets the value at column name with a java.sql.Date |
Record |
setValue(java.lang.String columnName,
double value)
sets the value at column name with a double |
Record |
setValue(java.lang.String columnName,
float value)
sets the value at column name with a float |
Record |
setValue(java.lang.String columnName,
int value)
sets the value at column name with a int |
Record |
setValue(java.lang.String columnName,
long value)
sets the value at column name with a long |
Record |
setValue(java.lang.String columnName,
java.lang.String value)
sets the value at column name with a String |
Record |
setValue(java.lang.String columnName,
java.sql.Time value)
sets the value at column name with a java.sql.Time |
Record |
setValue(java.lang.String columnName,
java.sql.Timestamp value)
sets the value at column name with a java.sql.Timestamp |
Record |
setValue(java.lang.String columnName,
Value value)
sets the value at column name with a Value |
Record |
setValueNull(int pos)
sets the value at pos with a NULL |
Record |
setValueNull(java.lang.String columnName)
sets the value at column name with a NULL |
int |
size()
the number of columns in this object |
boolean |
toBeSavedWithDelete()
whether or not this Record is to be saved with an SQL delete statement |
boolean |
toBeSavedWithInsert()
whether or not this Record is to be saved with an SQL insert statement |
boolean |
toBeSavedWithUpdate()
whether or not this Record is to be saved with an SQL update statement |
java.lang.String |
toString()
This returns a representation of this Record |
Record |
unmarkToBeDeleted()
Unmarks a record that has been marked for deletion. |
boolean |
valueIsClean(int i)
Determines whether or not a value stored in the record is clean. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Record()
public Record(DataSet ds) throws DataSetException, java.sql.SQLException
ds
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!
java.sql.SQLException
- TODO: DOCUMENT ME!Method Detail |
---|
public int save() throws DataSetException, java.sql.SQLException
DataSetException
- TODO: DOCUMENT ME!
java.sql.SQLException
- TODO: DOCUMENT ME!public int save(java.sql.Connection connection) throws DataSetException, java.sql.SQLException
connection
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!
java.sql.SQLException
- TODO: DOCUMENT ME!public java.lang.String getSaveString() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public Value getValue(int i) throws DataSetException
i
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Value getValue(java.lang.String columnName) throws DataSetException
columnName
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public int size()
public boolean toBeSavedWithInsert()
public boolean toBeSavedWithUpdate()
public boolean toBeSavedWithDelete()
public void markRecordClean() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public void markForInsert() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public void markForUpdate() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public Record markToBeDeleted() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public Record unmarkToBeDeleted() throws DataSetException
WARNING: You must reset the save type before trying to save this record again.
DataSetException
- TODO: DOCUMENT ME!markForUpdate()
,
markForInsert()
,
markToBeDeleted()
public void markValueClean(int pos) throws DataSetException
pos
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public void markValueClean(java.lang.String columnName) throws DataSetException
columnName
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public void markValueDirty(int pos) throws DataSetException
pos
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public void markValueDirty(java.lang.String columnName) throws DataSetException
columnName
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.math.BigDecimal value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, boolean value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, byte[] value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.util.Date value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.sql.Date value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, double value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, float value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, int value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, long value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.lang.String value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.sql.Time value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, java.sql.Timestamp value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(int pos, Value value) throws DataSetException
pos
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.math.BigDecimal value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, boolean value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, byte[] value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.util.Date value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.sql.Date value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, double value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, float value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, int value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, long value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.lang.String value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.sql.Time value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, java.sql.Timestamp value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValue(java.lang.String columnName, Value value) throws DataSetException
columnName
- TODO: DOCUMENT ME!value
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValueNull(int pos) throws DataSetException
pos
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public Record setValueNull(java.lang.String columnName) throws DataSetException
columnName
- TODO: DOCUMENT ME!
DataSetException
- TODO: DOCUMENT ME!public boolean isAZombie()
public boolean needsToBeSaved()
public boolean valueIsClean(int i)
i
- TODO: DOCUMENT ME!
public boolean recordIsClean()
public void refresh(java.sql.Connection connection) throws DataSetException, java.sql.SQLException
connection
-
DataSetException
java.sql.SQLException
public java.lang.String getRefreshQueryString() throws DataSetException
DataSetException
public void saveWithoutStatusUpdate() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public Schema schema() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public DataSet dataset()
public java.lang.String asFormattedString(java.lang.String valueseparator, int[] maxwidths) throws DataSetException
valueseparator
- maxwidths
-
DataSetException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |