|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.database.Record
| Field Summary |
| Fields inherited from interface ewe.database.DatabaseTypes |
BOOLEAN, BYTE_ARRAY, CREATED_FIELD, DATE, DATE_TIME, DECIMAL, DOUBLE, FIRST_SPECIAL_FIELD, FLAG_SYNCHRONIZED, FLAGS_FIELD, INTEGER, JAVA_OBJECT, LONG, MAX_ID, MODIFIED_BY_FIELD, MODIFIED_FIELD, NAME_FIELD, OBJECT_BYTES_FIELD, OBJECT_TEXT_FIELD, OID_FIELD, reservedFieldHeaders, reservedFieldIDs, reservedFieldNames, reservedFieldTypes, SORT_DATE_ONLY, SORT_IGNORE_CASE, SORT_TIME_ONLY, SORT_UNKNOWN_IS_GREATER_THAN_KNOWN, SORT_UNKNOWN_IS_LESS_THAN_KNOWN, STRING, TIME, TIMESTAMP |
| Constructor Summary | |
Record(Database db)
Create a Record for use with the specified Database. |
|
Record(Database db,
int[] fields)
Create a Record for use with the specified Database using but where only the specified fields will be read in from DatabaseEntry objects. |
|
| Method Summary | |
Object |
copyData(Object theData)
Return a copy of the data returned by getField() - unless that data is of type JAVA_OBJECT in which case a copy will only be returned if it implements ewe.util.Copyable. |
Database |
getDatabase()
|
Object |
getField(int fieldID)
Call this after a readFrom(). |
int[] |
getFields()
Return the fields that are being used with this Record. |
int |
getID(String fieldName)
Find the ID of a specified field given its name - throwing an IllegalArgumentException if the ID is not found. |
void |
readFrom(DatabaseEntry de)
Read the field values from the DatabaseEntry into the data objects being kept by the Record object. |
void |
reset()
This clears the data held by the Record, but still keeps the data objects used to hold the data. |
void |
selectFields(int[] fields)
Select the fields to be used by the Record - each of which must be a valid field for the Database used by the Record. |
Object |
setField(int fieldID)
This method is used to retrieve the data object used to wrap the field data, and at the same time mark that field as having its data set, for a later writeTo() operation. |
void |
setField(int fieldID,
Object fieldData)
This method should normally be used only if the field type is JAVA_OBJECT. |
Hashtable |
toHashtable()
Place copies of the field values in the Record into a new Hashtable, keyed by the field name. |
Hashtable |
toHashtable(Hashtable destination,
boolean copyData)
Place the field values (or copies of the values) in the Record into a Hashtable, keyed by the field name. |
PropertyList |
toPropertyList()
Place copies of the field values in the Record into a new PropertyList, keyed by the field name. |
PropertyList |
toPropertyList(PropertyList destination,
boolean copyData)
Place the field values (or copies of the values) in the Record into a PropertyList, keyed by the field name. |
void |
transferTo(int[] sourceFields,
int[] destFields,
DatabaseEntry dest)
Copy a set of fields from this Record into the destination DatabaseEntry (which may be from a different Database) into fields with IDs specified by destFields, and which are of the same type as the source fields. |
void |
writeTo(DatabaseEntry de)
Set the field values int the DatabaseEntry from the set data objects being kept by the Record object. |
void |
zero()
This sets all the data held by the Record to a zero value. |
void |
zeroData(Object theData)
Sets the data value to whatever is considered to be a zero value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Constructor Detail |
public Record(Database db)
public Record(Database db,
int[] fields)
| Method Detail |
public Database getDatabase()
public void selectFields(int[] fields)
throws IllegalArgumentException
IllegalArgumentExceptionpublic int[] getFields()
public void reset()
public void zero()
public Object setField(int fieldID)
throws IllegalArgumentException
fieldID - the field ID to look for.
IllegalArgumentException - if the fieldID is not being read in by this Record.
public void setField(int fieldID,
Object fieldData)
throws IllegalArgumentException
fieldID - the field ID to look for.fieldData - data object representing the field read in by readFrom().
IllegalArgumentException - if the fieldID is not being read in by this Record.public void readFrom(DatabaseEntry de)
public void writeTo(DatabaseEntry de)
public Object getField(int fieldID)
throws IllegalArgumentException
To keep a persistent copy of the data call copyData(Object data). Calling copyData() on an encoded JAVA_OBJECT is safe, it will simply return the same value.
fieldID - the field ID to look for.
IllegalArgumentException - if the fieldID is not being read in by this Record.
public int getID(String fieldName)
throws IllegalArgumentException
IllegalArgumentExceptionpublic Object copyData(Object theData)
public void zeroData(Object theData)
public void transferTo(int[] sourceFields,
int[] destFields,
DatabaseEntry dest)
throws IllegalArgumentException
sourceFields - An array of Field IDs which must be within the field list for
this Record object.destFields - An array of Field IDs, equal in length to the sourceFields array
but with values which correspond to destination fields in the destination DatabaseEntry.dest - the destination DatabaseEntry (which may be from a different Database).
IllegalArgumentException - if any of the sourceFields IDs is not in this Record
or if any of the destination field IDs are invalid or of the wrong type.
public Hashtable toHashtable(Hashtable destination,
boolean copyData)
destination - the destination Hashtable, or null to create a new one.copyData - set this true to save copies of the field data.
public Hashtable toHashtable()
public PropertyList toPropertyList(PropertyList destination,
boolean copyData)
destination - the destination PropertyList, or null to create a new one.copyData - set this true to save copies of the field data.
public PropertyList toPropertyList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||