|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.database.DatabaseEntryObject
| Field Summary | |
protected DatabaseObject |
database
|
protected boolean |
isDeleted
|
protected Locale |
locale
|
protected FoundEntries |
modifyingInside
|
protected ByteArray |
myData
|
| 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 | |
protected |
DatabaseEntryObject(DatabaseObject database)
|
| Method Summary | |
boolean |
_getSetField(String fieldName,
Wrapper value,
boolean isGet)
This is used as a mechanism for automatic data transfer between a DatabaseEntry and a user interface object. |
boolean |
_getSetValue(String fieldName,
Wrapper value,
boolean isGet)
This is used as a mechanism for automatic data transfer between a DatabaseEntry and an object that has the same field names. |
int |
compareTo(DatabaseEntry other,
int sortID)
Compare this entry with another based on the sortID stored in the database (ignoring the SORT_DESCENDING option). |
protected static Object |
convertStringToStaticObjectValue(Object value,
int type)
If the value is a String, convert it to an Object suitable for the specified type. |
boolean |
decode(byte[] source,
int offset,
int length)
|
void |
delete()
This will delete the entry from the database. |
protected abstract int |
discoverType(int field)
|
protected String |
dump()
|
void |
duplicateFrom(DatabaseEntry other)
Duplicate all set fields in this DatabaseEntry with those from the other. |
byte[] |
encode()
|
void |
erase()
This will erase the entry from the database. |
protected int |
fieldToID(String fieldName)
|
protected int |
fieldToType(int field)
|
int[] |
getAssignedFields()
|
Object |
getData()
Get the data from the entry, creating a new data object. |
Object |
getData(Object destination)
Get the data from the entry into a data object. |
Database |
getDatabase()
Get the database associated with the FoundEntries. |
BigDecimal |
getField(int fieldID,
BigDecimal defaultValue)
|
boolean |
getField(int fieldID,
boolean defaultValue)
|
ByteArray |
getField(int fieldID,
ByteArray dest)
|
CharArray |
getField(int fieldID,
CharArray dest)
|
DayOfYear |
getField(int fieldID,
DayOfYear dest)
|
Decimal |
getField(int fieldID,
Decimal dest)
|
double |
getField(int fieldID,
double defaultValue)
|
int |
getField(int fieldID,
int defaultValue)
|
long |
getField(int fieldID,
long defaultValue)
|
String |
getField(int fieldID,
String defaultValue)
|
Time |
getField(int fieldID,
Time dest)
|
TimeOfDay |
getField(int fieldID,
TimeOfDay dest)
|
TimeStamp |
getField(int fieldID,
TimeStamp dest)
|
byte[] |
getFieldBytes(int fieldID)
|
protected int |
getFieldInfo(String fieldName)
Return the field info as the id|type. |
protected String |
getFieldName(int id)
|
abstract Object |
getFieldValue(int fieldID,
int type,
Object data)
|
Object |
getFieldValue(int fieldID,
Object data)
|
DatabaseEntry |
getNew()
|
Object |
getObjectField(int fieldID,
Object dest)
|
boolean |
isADeletedEntry()
|
protected void |
load()
|
protected void |
markAsDeleted()
|
void |
reset()
Reset the entry to be an empty entry, as if it had just been returned by Database.getNewData() |
void |
revert()
Reload the entries data. |
void |
save()
This will save or add the entry into the database. |
void |
setData(Object data)
Set the data in the entry from the data object. |
void |
setField(int fieldID,
BigDecimal value)
|
void |
setField(int fieldID,
boolean value)
|
void |
setField(int fieldID,
byte[] bytes)
|
void |
setField(int fieldID,
ByteArray bytes)
|
void |
setField(int fieldID,
ByteEncodable value)
|
void |
setField(int fieldID,
CharArray chars)
|
void |
setField(int fieldID,
DayOfYear date)
|
void |
setField(int fieldID,
Decimal value)
|
void |
setField(int fieldID,
double value)
|
void |
setField(int fieldID,
int value)
|
void |
setField(int fieldID,
long value)
|
void |
setField(int fieldID,
String chars)
|
void |
setField(int fieldID,
SubString chars)
|
void |
setField(int fieldID,
Time time)
|
void |
setField(int fieldID,
TimeOfDay time)
|
void |
setField(int fieldID,
TimeStamp timestamp)
|
void |
setFieldValue(int fieldID,
Object data)
|
void |
setObjectField(int fieldID,
Object value)
|
void |
store()
This will store and add (if necessary) the entry into the database with no modifications. |
String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Methods inherited from interface ewe.database.DatabaseEntry |
clearDataAndSpecialFields, clearField, clearFields, compareTo, countAssignedFields, decode, encode, getAssignedFields, hasField, isPointingTo, isSaved, pointTo, setFieldValue |
| Field Detail |
protected ByteArray myData
protected DatabaseObject database
protected boolean isDeleted
protected FoundEntries modifyingInside
protected Locale locale
| Constructor Detail |
protected DatabaseEntryObject(DatabaseObject database)
| Method Detail |
protected static Object convertStringToStaticObjectValue(Object value,
int type)
value - the provided Object value, which may be a String.type - the type of the field being set.
public abstract Object getFieldValue(int fieldID,
int type,
Object data)
getFieldValue in interface DatabaseEntrypublic Database getDatabase()
getDatabase in interface DatabaseEntrypublic boolean isADeletedEntry()
isADeletedEntry in interface DatabaseEntrypublic void reset()
DatabaseEntry
reset in interface DatabaseEntry
public void save()
throws IllegalStateException,
IOException
DatabaseEntry
save in interface DatabaseEntryIllegalStateException - if the entry is a deleted entry or otherwise cannot be saved.
IOException - on error.
public void delete()
throws IOException
DatabaseEntry
delete in interface DatabaseEntryIOException - on error.
protected void markAsDeleted()
throws IOException
IOException
public void store()
throws IllegalStateException,
IOException
DatabaseEntry
store in interface DatabaseEntryIllegalStateException - if the entry is a deleted entry or otherwise cannot be saved.
IOException - on error.
public void erase()
throws IOException
DatabaseEntry
erase in interface DatabaseEntryIOException
public void revert()
throws IllegalStateException,
IOException
DatabaseEntry
revert in interface DatabaseEntryIOException
IllegalStateException - if the entry's data could not be reloaded, because
it was deleted, erased or reset.
protected void load()
throws IOException
IOException
public Object getData(Object destination)
throws IllegalArgumentException,
IllegalStateException
getData in interface DatabaseEntrydestination - a destination object. If this is null a new one will be created if
possible.
IllegalArgumentException - if the destination object is not the right type.
IllegalStateException - if a new object was requested but could not be created.
public Object getData()
throws IllegalStateException
getData in interface DatabaseEntryIllegalStateException - if a new object could not be created.
public void setData(Object data)
throws IllegalArgumentException
setData in interface DatabaseEntrydata - the data to set.
IllegalArgumentException - if the data object is the wrong type.public DatabaseEntry getNew()
public int compareTo(DatabaseEntry other,
int sortID)
throws IllegalArgumentException
DatabaseEntry
compareTo in interface DatabaseEntryIllegalArgumentException
public boolean _getSetField(String fieldName,
Wrapper value,
boolean isGet)
public boolean _getSetValue(String fieldName,
Wrapper value,
boolean isGet)
public void setFieldValue(int fieldID,
Object data)
setFieldValue in interface DatabaseEntry
public Object getFieldValue(int fieldID,
Object data)
getFieldValue in interface DatabaseEntry
public void setField(int fieldID,
int value)
setField in interface DatabaseEntry
public void setField(int fieldID,
long value)
setField in interface DatabaseEntry
public void setField(int fieldID,
boolean value)
setField in interface DatabaseEntry
public void setField(int fieldID,
double value)
setField in interface DatabaseEntry
public void setField(int fieldID,
Time time)
setField in interface DatabaseEntry
public void setField(int fieldID,
TimeOfDay time)
setField in interface DatabaseEntry
public void setField(int fieldID,
DayOfYear date)
setField in interface DatabaseEntry
public void setField(int fieldID,
TimeStamp timestamp)
setField in interface DatabaseEntry
public void setField(int fieldID,
BigDecimal value)
setField in interface DatabaseEntry
public void setField(int fieldID,
Decimal value)
setField in interface DatabaseEntry
public void setField(int fieldID,
ByteArray bytes)
setField in interface DatabaseEntry
public void setField(int fieldID,
byte[] bytes)
setField in interface DatabaseEntry
public void setField(int fieldID,
SubString chars)
setField in interface DatabaseEntry
public void setField(int fieldID,
CharArray chars)
setField in interface DatabaseEntry
public void setField(int fieldID,
String chars)
setField in interface DatabaseEntry
public void setField(int fieldID,
ByteEncodable value)
public void setObjectField(int fieldID,
Object value)
setObjectField in interface DatabaseEntry
public Object getObjectField(int fieldID,
Object dest)
getObjectField in interface DatabaseEntry
public int getField(int fieldID,
int defaultValue)
getField in interface DatabaseEntry
public long getField(int fieldID,
long defaultValue)
getField in interface DatabaseEntry
public boolean getField(int fieldID,
boolean defaultValue)
getField in interface DatabaseEntry
public double getField(int fieldID,
double defaultValue)
getField in interface DatabaseEntry
public Time getField(int fieldID,
Time dest)
getField in interface DatabaseEntry
public String getField(int fieldID,
String defaultValue)
getField in interface DatabaseEntry
public CharArray getField(int fieldID,
CharArray dest)
getField in interface DatabaseEntrypublic byte[] getFieldBytes(int fieldID)
getFieldBytes in interface DatabaseEntry
public ByteArray getField(int fieldID,
ByteArray dest)
getField in interface DatabaseEntry
public DayOfYear getField(int fieldID,
DayOfYear dest)
getField in interface DatabaseEntry
public TimeOfDay getField(int fieldID,
TimeOfDay dest)
getField in interface DatabaseEntry
public TimeStamp getField(int fieldID,
TimeStamp dest)
getField in interface DatabaseEntry
public BigDecimal getField(int fieldID,
BigDecimal defaultValue)
getField in interface DatabaseEntry
public Decimal getField(int fieldID,
Decimal dest)
getField in interface DatabaseEntrypublic int[] getAssignedFields()
getAssignedFields in interface DatabaseEntryprotected int getFieldInfo(String fieldName)
protected int fieldToID(String fieldName)
protected abstract int discoverType(int field)
protected String getFieldName(int id)
protected int fieldToType(int field)
protected String dump()
public String toString()
Object
toString in class Objectpublic void duplicateFrom(DatabaseEntry other)
DatabaseEntry
duplicateFrom in interface DatabaseEntrypublic byte[] encode()
encode in interface DatabaseEntry
public boolean decode(byte[] source,
int offset,
int length)
decode in interface DatabaseEntry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||