|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.dbtools.DBRecord<gDBR>
public abstract class DBRecord<gDBR extends DBRecord>
Nested Class Summary | |
---|---|
static interface |
DBRecord.DBChangeListener
The change listener interface |
Field Summary | |
---|---|
protected java.lang.String |
errorDescription
|
protected java.util.Set<java.lang.String> |
excludedUpdateFields
|
static java.lang.String |
FLD_creationMillis
|
static java.lang.String |
FLD_creationTime
|
static java.lang.String |
FLD_description
|
static java.lang.String |
FLD_lastUpdateAccount
|
static java.lang.String |
FLD_lastUpdateTime
|
static java.lang.String |
FLD_lastUpdateUser
|
protected boolean |
hasError
|
static int |
ID_SIZE
|
protected boolean |
isValidating
|
protected java.sql.SQLException |
lastSQLException
|
static int |
NOTIFY_GROUP
|
static java.lang.String |
PSEUDO_FIELD_CHAR
|
protected RTProperties |
tempProps
|
Constructor Summary | |
---|---|
|
DBRecord()
Default Constructor |
protected |
DBRecord(DBRecordKey<gDBR> key)
Constructor specifying the DBRecord Key |
Method Summary | ||
---|---|---|
protected DBFactory<gDBR> |
_getFactory()
Gets the DBFactory for this DBRecord |
|
gDBR |
_reload(java.lang.String... fldNames)
Reload the contents of this record from the DB |
|
void |
addChangedNotification(DBRecord.DBChangeListener cl)
Adds a change notification listener to this record |
|
void |
addExcludedUpdateFields(java.lang.String... fldNames)
Adds excluded field to list |
|
static java.lang.String |
adjustStringLength_1(java.lang.String v,
int maxLen)
Trims and adjusts the length of the specified value to the maximum specified length-1 (ignored if maximum length is '0'). |
|
static java.lang.String |
adjustStringLength(java.lang.String v,
int maxLen)
Trims and adjusts the length of the specified value to the maximum specified length (ignored if maximum length is '0'). |
|
void |
appendFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap)
Appends the field values for this DBRecord from the specified Map. Field values are converted to their proper type from the specified Map values. Similar to "setAllFieldValues", however the current field values are not cleared. |
|
void |
clearChanged()
Clears the changed state for this record. |
|
void |
clearError()
Clears the error state |
|
void |
clearExcludedUpdateFields()
Clear excluded fields |
|
void |
clearLastCaughtSQLException()
Clears the last caught SQLException |
|
boolean |
equals(java.lang.Object obj)
Returns true if the specified DBRecord key is equivalent to this record key |
|
boolean |
excludeFieldFromUpdate(DBField fld)
Returns true if the specified field should be excluded from the next update. |
|
boolean |
excludeFieldFromUpdate(java.lang.String fldName)
Returns true if the specified field should be excluded from the next update. |
|
void |
fireChangeNotification(java.lang.String fieldName)
Fires a change notification |
|
java.lang.Object |
geKeyValue(java.lang.String fldName,
java.lang.Object dft)
Gets the value for the specified key. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.String |
getCreationDateTime(java.util.TimeZone tz,
java.lang.String fmt)
Gets the formatted creation date/time of this record |
|
long |
getCreationMillis()
Gets the millisecond creation time of this record |
|
long |
getCreationTime()
Gets the creation time of this record |
|
static java.lang.String |
GetCurrentAccount()
Gets the current account |
|
static java.lang.String |
GetCurrentUser()
Gets the current user |
|
java.lang.String[] |
getDefaultFieldValueKey(java.lang.String fieldName)
Gets the default value keys for current table |
|
java.lang.String |
getDescription()
Gets the description field value |
|
java.lang.String |
getErrorDescription()
Gets the error state |
|
DBFactory<gDBR> |
getFactory(boolean required)
Gets the DBFactory instance for this DBRecord |
|
static
|
getFactory(DBRecord<T> dbr)
Returns the DBFactory instance for the specified DBRecord |
|
DBField |
getField(java.lang.String fldName)
Gets the DBField with the specified name, or null if the specified field name does not exist. |
|
boolean |
getFieldBoolean(java.lang.String fldName)
Gets the boolean value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
DateTime |
getFieldDateTime(java.lang.String fldName)
Gets the DateTime value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
double |
getFieldDouble(java.lang.String fldName)
Gets the double value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
float |
getFieldFloat(java.lang.String fldName)
Gets the float value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
int |
getFieldInt(java.lang.String fldName)
Gets the int value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
long |
getFieldLong(java.lang.String fldName)
Gets the long value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.String |
getFieldName(java.lang.String fldName)
Returns a case sensitive field name for the specified case insensitive field name. |
|
java.lang.String |
getFieldString(java.lang.String fldName)
Gets the String value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.Object |
getFieldValue(java.lang.String fldName)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
boolean |
getFieldValue(java.lang.String fldName,
boolean dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
DateTime |
getFieldValue(java.lang.String fldName,
DateTime dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
double |
getFieldValue(java.lang.String fldName,
double dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
float |
getFieldValue(java.lang.String fldName,
float dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
int |
getFieldValue(java.lang.String fldName,
int dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
long |
getFieldValue(java.lang.String fldName,
long dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.Object |
getFieldValue(java.lang.String fldName,
java.lang.Object dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.String |
getFieldValue(java.lang.String fldName,
java.lang.String dft)
Gets the value for the specified field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.Object |
getKeyValue(java.lang.String fldName)
Gets the value for the specified key. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.sql.SQLException |
getLastCaughtSQLException()
Gets the last caught SQLException |
|
java.lang.String |
getLastUpdateAccount()
Returns the last update account, if the 'lastUpdateAccount' field has been defined for this DBRecord, otherwise this method will return null. |
|
long |
getLastUpdateTime()
Gets the last update time |
|
static
|
getLastUpdateTime(DBFactory<T> factory)
Gets the most recent update time for a specified table |
|
java.lang.String |
getLastUpdateUser()
Returns the last update user, if the 'lastUpdateUser' field has been defined for this DBRecord, otherwise this method will return null. |
|
static
|
getNextGroup(DBFactory<T> fact,
java.sql.ResultSet rs,
int max)
This method returns the next 'max' DBRecords from the specified ResultSet |
|
java.lang.Object |
getOptionalFieldValue(java.lang.String fldName)
Gets the value for the specified optional field name. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
boolean |
getOptionalFieldValue(java.lang.String fldName,
boolean dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
DateTime |
getOptionalFieldValue(java.lang.String fldName,
DateTime dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
double |
getOptionalFieldValue(java.lang.String fldName,
double dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
float |
getOptionalFieldValue(java.lang.String fldName,
float dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
int |
getOptionalFieldValue(java.lang.String fldName,
int dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
long |
getOptionalFieldValue(java.lang.String fldName,
long dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.Object |
getOptionalFieldValue(java.lang.String fldName,
java.lang.Object dft)
Gets the value for the specified optional field name. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
java.lang.String |
getOptionalFieldValue(java.lang.String fldName,
java.lang.String dft)
Gets the value for the specified optional field. Note: This function bypasses the normal 'getter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
static
|
getRecordCount(DBFactory<T> fact)
Returns the number of records contained in the table represented by the specified DBFactory. NOTE: Recommended for MyISAM tables only. |
|
static
|
getRecordCount(DBFactory<T> fact,
DBWhere where)
Returns the number of records contained in the table represented by the specified DBFactory and based on the specified 'where' clause. NOTE: Recommended for MyISAM tables only. |
|
static
|
getRecordCount(DBFactory<T> fact,
java.lang.String where)
Returns the number of records contained in the table represented by the specified DBFactory and based on the specified 'where' clause. NOTE: Recommended for MyISAM tables only. |
|
static
|
getRecordCount(DBFactory<T> fact,
java.lang.StringBuffer where)
Returns the number of records contained in the table represented by the specified DBFactory and based on the specified 'where' clause. NOTE: Recommended for MyISAM tables only. |
|
static
|
getRecordCount(DBSelect<T> dsel)
Returns the number of records contained in the table represented by the specified DBSelect (which specifies a DBFactory). NOTE: Recommended for MyISAM tables only. |
|
DBRecordKey<gDBR> |
getRecordKey()
Return the DBRecordKey instance for this record |
|
static
|
getRecords(DBFactory<T> fact,
java.lang.String where,
java.lang.String[] orderBy,
boolean ascending)
Gets an array of DBRecords based on the specified 'where' clause |
|
static
|
getRecords(DBFactory<T> fact,
java.lang.String where,
java.lang.String addtnlSel,
java.lang.String[] orderBy,
boolean ascending,
long limit,
long offset)
Gets an array of DBRecords based on the specified 'where' clause |
|
static java.lang.String |
getTableDescription(java.util.Locale loc)
Return the table description |
|
RTProperties |
getTemporaryProperties()
Gets a temporary properties instance for this DBRecord |
|
java.lang.Object |
getValue(java.lang.String fldName)
Gets the value for the specified field. |
|
boolean |
getVirtual()
Gets the "virtual" state |
|
boolean |
hasChanged()
Returns true if this record has changed |
|
boolean |
hasError()
Returns true if this record has encountered an error |
|
boolean |
hasField(java.lang.String fldName)
Returns true if a defined field with the specified name exists for this DBRecord |
|
boolean |
hasFieldValue(java.lang.String fldName)
Returns true if the specified field name has a defined value |
|
boolean |
hasOptionalFieldValue(java.lang.String fldName)
Returns true if the specified field name has a defined value. Returns null if the column does not exist, or if it does exist, but contains a 'NULL' value. |
|
boolean |
hasTemporaryProperties()
Returns true if this DBRecord has a temporary properties instance defined |
|
void |
insert()
Insert this DBRecord in the database. An exception will be throw if the record already exists |
|
boolean |
isFieldUnsigned(java.lang.String fldName)
Returns true if the specified field is an unsigned integer. |
|
boolean |
isLastCaughtSQLExceptionErrorCode(int code)
Returns true if the specified code matches the error code
of the last caught SQLException |
|
boolean |
isOkToReload()
Returns true if this DBRecord is ok to reload |
|
boolean |
isOkToSave()
Returns true if this DBRecord is ok to save |
|
protected boolean |
isValidating()
Returns true if this record is validating |
|
boolean |
isVirtual()
Gets the "virtual" state |
|
boolean |
lock(java.lang.String[] writeTables,
java.lang.String[] readTables)
Lock specified tables for write/read |
|
boolean |
lockRead()
Lock table associated with this DBRecord for reading |
|
boolean |
lockWrite()
Lock table associated with this DBRecord for writing |
|
static DBField |
newField_creationMillis(java.lang.String xAttr)
Returns a new millisecond creation time field |
|
static DBField |
newField_creationTime()
Returns a new creation time field |
|
static DBField |
newField_creationTime(boolean isAltKey)
Returns a new creation time field |
|
protected static DBField |
newField_description()
Creates a new "description" key field definition |
|
protected static DBField |
newField_description(java.lang.String xAttr)
Creates a new "description" key field definition |
|
static DBField |
newField_lastUpdateAccount()
Creates a new DBField instance for adding a 'lastUpdateAccount' field to the DBFactory instance at startup initialization time. |
|
static DBField |
newField_lastUpdateAccount(boolean checkRTP)
Creates a new DBField instance for adding a 'lastUpdateAccount' field to the DBFactory instance at startup initialization time. |
|
static DBField |
newField_lastUpdateTime()
Returns a new last update time field |
|
static DBField |
newField_lastUpdateUser()
Creates a new DBField instance for adding a 'lastUpdateUser' field to the DBFactory instance at startup initialization time. |
|
static DBField |
newField_lastUpdateUser(boolean checkRTP)
Creates a new DBField instance for adding a 'lastUpdateUser' field to the DBFactory instance at startup initialization time. |
|
static void |
printXML(java.io.PrintWriter out,
DBRecord<?>... dbr)
Encodes all field of the specified DBRecords into XML and writes it to a specified PrintWriter |
|
void |
printXML(java.io.PrintWriter out,
int indent,
java.util.Set<java.lang.String> fldNames)
Encodes this DBRecord into XML and writes it to a specified PrintWriter |
|
void |
printXML(java.io.PrintWriter out,
int indent,
java.util.Set<java.lang.String> fldNames,
boolean soapXml)
Contains boolean value used to encode xml that will be embedded within a SOAP envelope. |
|
static void |
printXML(java.io.PrintWriter out,
int indent,
java.util.Set<java.lang.String> fldNames,
DBRecord<?>... dbr)
Encodes the specified DBRecords into XML and writes it to a specified PrintWriter |
|
void |
printXML(java.io.PrintWriter out,
int indent,
java.util.Set<java.lang.String> fldNames,
int sequence)
Encodes this DBRecord into XML and writes it to a specified PrintWriter |
|
void |
printXML(java.io.PrintWriter out,
int indent,
java.util.Set<java.lang.String> fldNames,
int sequence,
boolean soapXML)
Encodes this DBRecord into XML and writes it to a specified PrintWriter |
|
protected void |
recordDidInsert()
Callback after record has been be inserted into the table |
|
protected void |
recordDidUpdate()
Callback after record has been be updated in the table |
|
protected void |
recordWillInsert()
Callback when record is about to be inserted into the table |
|
protected void |
recordWillUpdate()
Callback when record is about to be updated in the table |
|
gDBR |
reload()
Reload the contents of this record from the DB |
|
gDBR |
reload(java.lang.String... fldNames)
Reload the contents of this record from the DB |
|
void |
removeChangedNotification(DBRecord.DBChangeListener cl)
Removes a change notification listener from this record |
|
void |
save()
Saves (ie. |
|
protected static
|
select(DBFactory<T> fact,
java.lang.String where,
java.lang.String addtnlSel,
java.lang.String[] orderBy,
boolean ascending,
long limit,
long offset,
DBRecordHandler<T> rcdHandler)
Gets an array of DBRecords based on the specified 'where' clause |
|
protected static
|
select(DBSelect<T> dsel)
Gets an array of DBRecords based on the specified 'where' clause |
|
protected static
|
select(DBSelect<T> dsel,
DBRecordHandler<T> rcdHandler)
Gets an array of DBRecords based on the specified 'where' clause |
|
void |
setAllFieldValues(DBRecord<gDBR> rcd)
Sets the field values for this DBRecord from the specified DBRecord (primary keys are not copied) |
|
void |
setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap)
Sets the field values for this DBRecord from the specified Map. Field values are converted to their proper type from the specified Map values. All current field values are cleared (except primary key values). |
|
void |
setAllFieldValues(java.sql.ResultSet rs)
Sets the field values for this DBRecord from the specified SQL ResultSet (primary keys are not copied) |
|
void |
setAllFieldValues(java.sql.ResultSet rs,
java.lang.String... fldNames)
Sets the field values for this DBRecord from the specified SQL ResultSet (primary keys are not copied) |
|
void |
setChanged(java.lang.String fieldName)
Sets the 'changed' state of this record, and sends a change notification to any registered listeners. |
|
void |
setChanged(java.lang.String fieldName,
java.lang.Object oldVal,
java.lang.Object newVal)
Sets the 'changed' state of this record, and sends a change notification to any registered listeners. |
|
void |
setCreationDefaultValues()
Override to set default values |
|
protected boolean |
setCreationMillis(long millis)
Sets the millisecond creation time of this record |
|
protected boolean |
setCreationTime(long time)
Sets the creation time of this record |
|
static void |
SetCurrentAccount(java.lang.String acct)
Sets the current account |
|
static void |
SetCurrentUser(java.lang.String user)
Sets the current user |
|
void |
setDescription(java.lang.String v)
Sets the description field value |
|
void |
setError()
Sets the error state |
|
void |
setError(java.lang.String desc)
Sets the error state with a description |
|
void |
setFieldValue(java.lang.String fldName,
boolean value)
Sets the boolean value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setFieldValue(java.lang.String fldName,
double value)
Sets the double value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setFieldValue(java.lang.String fldName,
float value)
Sets the float value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setFieldValue(java.lang.String fldName,
int value)
Sets the int value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setFieldValue(java.lang.String fldName,
long value)
Sets the long value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
boolean |
setFieldValue(java.lang.String fldName,
java.lang.Object value)
Sets the value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setFieldValue(java.lang.String fldName,
java.lang.String value)
Sets the String value for the specified field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setIgnoreInvalidFields(boolean state)
Sets the state for ignoring invalid field names. |
|
boolean |
setKeyValue(java.lang.String fldName,
java.lang.Object value)
Sets the value for the specified key. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
protected void |
setLastCaughtSQLException(java.sql.SQLException sqe)
Sets the last caught SQLException |
|
boolean |
setLastUpdateAccount(java.lang.String acct,
boolean allowBlank)
Sets the last update account if the 'lastUpdateAccount' field has been defined for this DBRecord, otherwise this method will have no effect. |
|
protected boolean |
setLastUpdateTime(long time)
Sets the last update time of this record |
|
boolean |
setLastUpdateUser(java.lang.String user,
boolean allowBlank)
Sets the last update user if the 'lastUpdateUser' field has been defined for this DBRecord, otherwise this method will have no effect. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
boolean value)
Sets the boolean value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
DateTime value)
Sets the DateTime value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
double value)
Sets the double value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
float value)
Sets the float value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
int value)
Sets the int value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
long value)
Sets the long value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
java.lang.Object value)
Sets the value for the specified optional field name. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setOptionalFieldValue(java.lang.String fldName,
java.lang.String value)
Sets the String value for the specified optional field. Note: This function bypasses the normal 'setter' methods for the specific DBRecord subclass, and thus may not perform some of the bounds checking for the specific field. |
|
void |
setRuntimeDefaultValues()
Override to set default values |
|
protected void |
setValidating(boolean validate)
Sets if this record id validating [CHECK] |
|
void |
setValue(java.lang.String fldName,
boolean value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
double value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
float value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
int value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
long value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
java.lang.Object value)
Sets the value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setValue(java.lang.String fldName,
java.lang.String value)
Sets the String value for the specified field. This method attempts to use the field 'setter' method for setting the field value. |
|
void |
setVirtual(boolean isVirtual)
Sets the "virtual" state |
|
java.lang.String |
toString()
Returns a String representation of the DBRecordKey for this DBRecord |
|
java.lang.StringBuffer |
toXML(java.lang.StringBuffer sb,
int indent,
java.util.Set<java.lang.String> fldNames)
Encodes this DBRecord into XML |
|
java.lang.StringBuffer |
toXML(java.lang.StringBuffer sb,
int indent,
java.util.Set<java.lang.String> fldNames,
boolean soapXML)
Encodes this DBRecord into XML |
|
java.lang.StringBuffer |
toXML(java.lang.StringBuffer sb,
int indent,
java.util.Set<java.lang.String> fldNames,
int sequence)
Encodes this DBRecord into XML |
|
java.lang.StringBuffer |
toXML(java.lang.StringBuffer sb,
int indent,
java.util.Set<java.lang.String> fldNames,
int sequence,
boolean soapXML)
Encodes this DBRecord into XML |
|
java.lang.StringBuffer |
toXML(java.lang.StringBuffer sb,
int indent,
java.util.Set<java.lang.String> fldNames,
int sequence,
boolean inclBlank,
boolean soapXML)
Encodes this DBRecord into XML |
|
boolean |
unlock()
Unlock locked tables |
|
void |
update()
Updates all the fields in this DBRecord. |
|
void |
update(java.util.Set<java.lang.String> updFldSet)
Updates the specified fields in this DBRecord. |
|
void |
update(java.lang.String... updFldArray)
Updates the specified fields in this DBRecord. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NOTIFY_GROUP
public static final int ID_SIZE
public static final java.lang.String PSEUDO_FIELD_CHAR
public static final java.lang.String FLD_description
public static final java.lang.String FLD_creationTime
public static final java.lang.String FLD_creationMillis
public static final java.lang.String FLD_lastUpdateTime
public static final java.lang.String FLD_lastUpdateAccount
public static final java.lang.String FLD_lastUpdateUser
protected boolean isValidating
protected java.sql.SQLException lastSQLException
protected boolean hasError
protected java.lang.String errorDescription
protected java.util.Set<java.lang.String> excludedUpdateFields
protected RTProperties tempProps
Constructor Detail |
---|
public DBRecord()
protected DBRecord(DBRecordKey<gDBR> key)
key
- The DBRecordKey for this DBRecordMethod Detail |
---|
public static java.lang.String getTableDescription(java.util.Locale loc)
loc
- The Locale
public static java.lang.String adjustStringLength(java.lang.String v, int maxLen)
v
- The String valuemaxLen
- The maximum length
public static java.lang.String adjustStringLength_1(java.lang.String v, int maxLen)
v
- The String valuemaxLen
- The maximum length
public static <T extends DBRecord> long getRecordCount(DBFactory<T> fact) throws DBException
fact
- The DBFactory instance
DBException
- If a general DB error occurspublic static <T extends DBRecord> long getRecordCount(DBFactory<T> fact, java.lang.StringBuffer where) throws DBException
fact
- The DBFactory instancewhere
- The 'where' selection clause
DBException
- If a general DB error occurspublic static <T extends DBRecord> long getRecordCount(DBFactory<T> fact, java.lang.String where) throws DBException
fact
- The DBFactory instancewhere
- The 'where' selection clause
DBException
- If a general DB error occurspublic static <T extends DBRecord> long getRecordCount(DBFactory<T> fact, DBWhere where) throws DBException
fact
- The DBFactory instancewhere
- The 'where' selection clause
DBException
- If a general DB error occurspublic static <T extends DBRecord> long getRecordCount(DBSelect<T> dsel) throws DBException
dsel
- The DBSelect instance.
DBException
- If a general DB error occurspublic static java.lang.String GetCurrentAccount()
public static void SetCurrentAccount(java.lang.String acct)
acct
- The current accountpublic static java.lang.String GetCurrentUser()
public static void SetCurrentUser(java.lang.String user)
user
- The current userpublic DBRecordKey<gDBR> getRecordKey()
public static <T extends DBRecord> DBFactory<T> getFactory(DBRecord<T> dbr)
dbr
- The DBRecord instance
public DBFactory<gDBR> getFactory(boolean required) throws DBException
required
- True if the DBFactory is required to be defined, in which case
this method will throw a DBException if the DBFactory is null.
DBException
- if 'required' is true and the DBFactory isn't definedprotected DBFactory<gDBR> _getFactory()
public static <T extends DBRecord> T[] getNextGroup(DBFactory<T> fact, java.sql.ResultSet rs, int max) throws DBException
fact
- The DBFactoryrs
- The ResultSetmax
- The number of DBRecords to return
DBException
- If a database error occurspublic static <T extends DBRecord> T[] getRecords(DBFactory<T> fact, java.lang.String where, java.lang.String[] orderBy, boolean ascending) throws DBException
fact
- The DBFactorywhere
- The Where clauseorderBy
- The select 'Order By' statementascending
- True to return the records in ascending order
DBException
- If a DB access error occurspublic static <T extends DBRecord> T[] getRecords(DBFactory<T> fact, java.lang.String where, java.lang.String addtnlSel, java.lang.String[] orderBy, boolean ascending, long limit, long offset) throws DBException
fact
- The DBFactorywhere
- The Where clauseaddtnlSel
- Additional selection criteriaorderBy
- The select 'Order By' statementascending
- True to return the records in ascending orderlimit
- The maximum number of records to returnoffset
- The the offset within the selected DB records
DBException
- If a DB access error occursprotected static <T extends DBRecord> T[] select(DBFactory<T> fact, java.lang.String where, java.lang.String addtnlSel, java.lang.String[] orderBy, boolean ascending, long limit, long offset, DBRecordHandler<T> rcdHandler) throws DBException
fact
- The DBFactorywhere
- The Where clauseaddtnlSel
- Additional selection criteriaorderBy
- The select 'Order By' statementascending
- True to return the records in ascending orderlimit
- The maximum number of records to returnoffset
- The the offset within the selected DB recordsrcdHandler
- The optional DBRecordHandler
DBException
- If a DB access error occursprotected static <T extends DBRecord> T[] select(DBSelect<T> dsel) throws DBException
dsel
- The DBSelect selection criteria
DBException
- If a DB access error occursprotected static <T extends DBRecord> T[] select(DBSelect<T> dsel, DBRecordHandler<T> rcdHandler) throws DBException
dsel
- The DBSelect selection criteriarcdHandler
- The optional DBRecordHandler
DBException
- If a DB access error occurspublic boolean hasChanged()
public void setChanged(java.lang.String fieldName)
fieldName
- The changed fieldpublic void setChanged(java.lang.String fieldName, java.lang.Object oldVal, java.lang.Object newVal)
fieldName
- The changed fieldoldVal
- The previous value of the fieldnewVal
- The new value of the fieldpublic void clearChanged()
public void addChangedNotification(DBRecord.DBChangeListener cl)
cl
- The change notification listener to addpublic void removeChangedNotification(DBRecord.DBChangeListener cl)
cl
- The change notification listener to removepublic void fireChangeNotification(java.lang.String fieldName)
fieldName
- The changed fieldpublic boolean hasError()
public void clearError()
public void setError()
public void setError(java.lang.String desc)
desc
- The description of the errorpublic java.lang.String getErrorDescription()
public gDBR reload()
public gDBR reload(java.lang.String... fldNames)
fldNames
- The list of field names to reload (null for all fields)
public gDBR _reload(java.lang.String... fldNames) throws DBException
DBException
- If a general DB error occurspublic void setCreationDefaultValues()
public java.lang.String[] getDefaultFieldValueKey(java.lang.String fieldName)
fieldName
- The field name
public void setRuntimeDefaultValues()
public static <T extends DBRecord> long getLastUpdateTime(DBFactory<T> factory) throws DBException
factory
- The DBFactory to get the upate time of
DBException
- If a general DB error occursprotected static DBField newField_description()
protected static DBField newField_description(java.lang.String xAttr)
public java.lang.String getDescription()
public void setDescription(java.lang.String v)
v
- The record descriptionpublic static DBField newField_creationTime(boolean isAltKey)
public static DBField newField_creationTime()
public java.lang.String getCreationDateTime(java.util.TimeZone tz, java.lang.String fmt)
public long getCreationTime()
protected boolean setCreationTime(long time)
time
- The creation time
public static DBField newField_creationMillis(java.lang.String xAttr)
public long getCreationMillis()
protected boolean setCreationMillis(long millis)
millis
- The millisecond creation time
public static DBField newField_lastUpdateTime()
public long getLastUpdateTime()
protected boolean setLastUpdateTime(long time)
time
- The last update time
public static DBField newField_lastUpdateAccount(boolean checkRTP)
checkRTP
- Check runtime property for inclusion
public static DBField newField_lastUpdateAccount()
public java.lang.String getLastUpdateAccount()
public boolean setLastUpdateAccount(java.lang.String acct, boolean allowBlank)
acct
- The last update accountallowBlank
- True to allow a blank account-idpublic static DBField newField_lastUpdateUser(boolean checkRTP)
checkRTP
- Check runtime property for inclusion
public static DBField newField_lastUpdateUser()
public java.lang.String getLastUpdateUser()
public boolean setLastUpdateUser(java.lang.String user, boolean allowBlank)
user
- The last update userpublic void insert() throws DBException
DBException
- if a database error occurs.public void update() throws DBException
DBException
- if a database error occurs.public void update(java.lang.String... updFldArray) throws DBException
updFldArray
- An array of fields to update.
DBException
- if a database error occurs.public void update(java.util.Set<java.lang.String> updFldSet) throws DBException
updFldSet
- A Set of fields to update.
DBException
- if a database error occurs.public void clearExcludedUpdateFields()
public void addExcludedUpdateFields(java.lang.String... fldNames)
fldNames
- The field names which are to be excluded on the next updatepublic boolean excludeFieldFromUpdate(DBField fld)
fld
- The Field to check
public boolean excludeFieldFromUpdate(java.lang.String fldName)
fldName
- The Field to check
public void setVirtual(boolean isVirtual)
public boolean getVirtual()
public boolean isVirtual()
public boolean isOkToSave()
public boolean isOkToReload()
public void save() throws DBException
DBException
- If a database error occurspublic boolean lockWrite() throws DBException
DBException
- If a database error occursDBProvider.lockTables(java.lang.String[], java.lang.String[])
public boolean lockRead() throws DBException
DBException
- If a database error occursDBProvider.lockTables(java.lang.String[], java.lang.String[])
public boolean lock(java.lang.String[] writeTables, java.lang.String[] readTables) throws DBException
writeTables
- The array of tables to lock for writing. If null,
defaults to the table assocated with this DBRecordreadTables
- The array of tables to lock for reading
DBException
- If a database error occursDBProvider.lockTables(java.lang.String[], java.lang.String[])
public boolean unlock() throws DBException
DBException
- If a database error occursDBProvider.unlockTables()
public java.lang.String getFieldName(java.lang.String fldName)
fldName
- A case-insensitive field name
public void setIgnoreInvalidFields(boolean state)
state
- True to ignore invalid field names, false to emit errors.public DBField getField(java.lang.String fldName)
fldName
- The field name
public boolean hasField(java.lang.String fldName)
public boolean hasFieldValue(java.lang.String fldName)
public boolean isFieldUnsigned(java.lang.String fldName)
public boolean hasOptionalFieldValue(java.lang.String fldName)
fldName
- The field name to retrieve
public java.lang.Object getOptionalFieldValue(java.lang.String fldName)
fldName
- The field name to retrieve
public java.lang.Object getOptionalFieldValue(java.lang.String fldName, java.lang.Object dft)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, java.lang.Object value)
fldName
- The field name to setvalue
- The value to set.public java.lang.Object getKeyValue(java.lang.String fldName)
fldName
- The key name to retrieve
public java.lang.Object geKeyValue(java.lang.String fldName, java.lang.Object dft)
fldName
- The key name to retrievedft
- The default value returned if the key does not exist, or has not been initialized.
public boolean setKeyValue(java.lang.String fldName, java.lang.Object value)
fldName
- The key name to setvalue
- The value to set.
public java.lang.Object getFieldValue(java.lang.String fldName)
fldName
- The field name to retrieve
public java.lang.Object getFieldValue(java.lang.String fldName, java.lang.Object dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public boolean setFieldValue(java.lang.String fldName, java.lang.Object value)
fldName
- The field name to setvalue
- The value to set.
public java.lang.Object getValue(java.lang.String fldName)
fldName
- The field name to retrieve
public void setValue(java.lang.String fldName, java.lang.Object value)
fldName
- The field name to setvalue
- The value to set.public java.lang.String getOptionalFieldValue(java.lang.String fldName, java.lang.String dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public java.lang.String getFieldValue(java.lang.String fldName, java.lang.String dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public java.lang.String getFieldString(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, java.lang.String value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, java.lang.String value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, java.lang.String value)
fldName
- The field name to setvalue
- The value to set.public boolean getOptionalFieldValue(java.lang.String fldName, boolean dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public boolean getFieldValue(java.lang.String fldName, boolean dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public boolean getFieldBoolean(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, boolean value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, boolean value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, boolean value)
fldName
- The field name to setvalue
- The value to set.public int getOptionalFieldValue(java.lang.String fldName, int dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public int getFieldValue(java.lang.String fldName, int dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public int getFieldInt(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, int value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, int value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, int value)
fldName
- The field name to setvalue
- The value to set.public long getOptionalFieldValue(java.lang.String fldName, long dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public long getFieldValue(java.lang.String fldName, long dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public long getFieldLong(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, long value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, long value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, long value)
fldName
- The field name to setvalue
- The value to set.public float getOptionalFieldValue(java.lang.String fldName, float dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public float getFieldValue(java.lang.String fldName, float dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public float getFieldFloat(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, float value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, float value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, float value)
fldName
- The field name to setvalue
- The value to set.public double getOptionalFieldValue(java.lang.String fldName, double dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public double getFieldValue(java.lang.String fldName, double dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public double getFieldDouble(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, double value)
fldName
- The field name to setvalue
- The value to setpublic void setFieldValue(java.lang.String fldName, double value)
fldName
- The field name to setvalue
- The value to setpublic void setValue(java.lang.String fldName, double value)
fldName
- The field name to setvalue
- The value to set.public DateTime getOptionalFieldValue(java.lang.String fldName, DateTime dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public DateTime getFieldValue(java.lang.String fldName, DateTime dft)
fldName
- The field name to retrievedft
- The default value returned if the field does not exist, or has not been initialized.
public DateTime getFieldDateTime(java.lang.String fldName)
fldName
- The field name to retrieve
public void setOptionalFieldValue(java.lang.String fldName, DateTime value)
fldName
- The field name to setvalue
- The value to setpublic void setAllFieldValues(DBRecord<gDBR> rcd) throws DBException
rcd
- The other DBRecord instance from which field values are copied
DBException
- If a database error occurspublic void setAllFieldValues(java.sql.ResultSet rs) throws DBException
rs
- The SQL ResultSet
DBException
- If a database error occurspublic void setAllFieldValues(java.sql.ResultSet rs, java.lang.String... fldNames) throws DBException
rs
- The SQL ResultSetfldNames
- The list of field names to set (null for all fields)
DBException
- If a database error occurspublic void setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap) throws DBException
valMap
- The Field==>Value map
DBException
- If a database error occurspublic void appendFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap) throws DBException
valMap
- The Field==>Value map
DBException
- If a database error occursprotected void setLastCaughtSQLException(java.sql.SQLException sqe)
sqe
- The last caught SQL Exceptionpublic void clearLastCaughtSQLException()
public java.sql.SQLException getLastCaughtSQLException()
public boolean isLastCaughtSQLExceptionErrorCode(int code)
code
matches the error code
of the last caught SQLException
code
- The code to compare with the last SQLException error code
code
matches the error code of the last
caught SQLExceptionprotected void setValidating(boolean validate)
validate
- If this record is validatingprotected boolean isValidating()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The specified DBRecord key
obj
is equivilent to this record keypublic java.lang.String toString()
toString
in class java.lang.Object
public static void printXML(java.io.PrintWriter out, DBRecord<?>... dbr)
out
- The PrintWriterdbr
- The list of DBRecordspublic static void printXML(java.io.PrintWriter out, int indent, java.util.Set<java.lang.String> fldNames, DBRecord<?>... dbr)
out
- The PrintWriterindent
- The number of spaces to indentfldNames
- The set of field names to includedbr
- The list of DBRecordspublic void printXML(java.io.PrintWriter out, int indent, java.util.Set<java.lang.String> fldNames)
out
- The PrintWriterindent
- The number of spaces to indentfldNames
- The set of field names to includepublic void printXML(java.io.PrintWriter out, int indent, java.util.Set<java.lang.String> fldNames, boolean soapXml)
out
- indent
- fldNames
- soapXml
- public void printXML(java.io.PrintWriter out, int indent, java.util.Set<java.lang.String> fldNames, int sequence)
out
- The PrintWriterindent
- The number of spaces to indentfldNames
- The set of field names to includesequence
- Optional sequence valuepublic void printXML(java.io.PrintWriter out, int indent, java.util.Set<java.lang.String> fldNames, int sequence, boolean soapXML)
out
- The PrintWriterindent
- The number of spaces to indentfldNames
- The set of field names to includesequence
- Optional sequence valuesoapXML
- True is SOAP XMLpublic java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, java.util.Set<java.lang.String> fldNames)
sb
- The StringBuffer to write the DBRecord XML toindent
- The number of spaces to indentfldNames
- The set of field names to include
public java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, java.util.Set<java.lang.String> fldNames, boolean soapXML)
sb
- The StringBuffer to write the DBRecord XML toindent
- The number of spaces to indentfldNames
- The set of field names to includesoapXML
- True if SOAP XML
public java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, java.util.Set<java.lang.String> fldNames, int sequence)
sb
- The StringBuffer to write the DBRecord XML toindent
- The number of spaces to indentfldNames
- The set of field names to includesequence
- Optional sequence value
public java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, java.util.Set<java.lang.String> fldNames, int sequence, boolean soapXML)
sb
- The StringBuffer to write the DBRecord XML toindent
- The number of spaces to indentfldNames
- The set of field names to includesequence
- Optional sequence valuesoapXML
- True if SOAP XML
public java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, java.util.Set<java.lang.String> fldNames, int sequence, boolean inclBlank, boolean soapXML)
sb
- The StringBuffer to write the DBRecord XML toindent
- The number of spaces to indentfldNames
- The set of field names to includesequence
- Optional sequence valueinclBlank
- Include blank fieldssoapXML
- True if SOAP XML
protected void recordWillInsert()
protected void recordDidInsert()
protected void recordWillUpdate()
protected void recordDidUpdate()
public RTProperties getTemporaryProperties()
public boolean hasTemporaryProperties()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |