|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.dc.core.objects.DCObject
Base class for all Data Crow objects. Here the fields, values and required fields are stored. Checks are done to garantee uniqueness and validity of the records. Objects which extend this class need to override the save and load methods
Field Summary | |
static int |
_ID
|
protected static boolean |
alwaysGenerateID
|
protected boolean |
bValidation
Indicates of the data should be checked for validity |
protected int |
module
|
protected java.lang.String |
sTableName
|
protected int |
uiRowNumber
|
protected java.util.Vector |
values
|
protected static WorkFlow |
wf
|
Constructor Summary | |
protected |
DCObject()
Creates an empty data crow object |
Method Summary | |
boolean |
checkIntegrity(boolean update)
Checks if the values are unique and if all the required fields have been filled |
void |
clearValues()
Sets all values to empty |
void |
delete(RequestorCollection requestors)
|
java.lang.String[] |
getChangedFieldNames()
Returns the labels of the fields that have been marked as changed |
java.lang.Object[] |
getChangedFieldValues()
Returns the values of the fields that have been marked as changed |
java.lang.String[] |
getCreateStatements()
Returns the create statement for the table for this object |
java.lang.String |
getDatabaseFieldName(int index)
Returns the database field name for the given field |
java.lang.String[] |
getDatabaseFieldNames()
Returns all the database field names |
DCFieldDefinition |
getField(int index)
Returns the field definition object for the given field index |
int[] |
getFieldIndices()
Returns all field indices |
DCFieldDefinition[] |
getFields()
Returns all the field definitions. |
int |
getFieldType(int index)
Returns the UI field type for the given field |
int[] |
getFieldTypes()
Returns all the UI field types |
int[] |
getHiddenFields()
Retrieves all currently, to the user, hidden fields |
abstract javax.swing.ImageIcon |
getIcon()
Returns the icon for this object. |
java.lang.String |
getID()
Retrieves the ID for this data crow object |
java.lang.String |
getLabel(int index)
Retrieves the label for the given field |
java.lang.String[] |
getLabels()
Retrieves all field labels |
int |
getMaxFieldLength(int index)
Retrieves the maximum length for the given field |
int[] |
getMaxFieldLengths()
Retrieves the maximum length(s) for all the fields |
DCModule |
getModule()
Returns the module to which this object belongs. |
int[] |
getNotSearchableFields()
Retrieves all fields on which a search cannot be performed. |
int[] |
getReadOnlyFields()
Returns the fields that are uneditable to the user |
int[] |
getRequiredFields()
Returns the required field names |
boolean |
getSilence()
Indicates if queries should display output |
java.lang.String |
getTableName()
Returns the table name for this data crow object |
java.lang.String |
getUnfilledRequiredFields()
Checks to see whether al required fields have been filled |
java.lang.Object |
getValue(int index)
Returns the value of a field |
java.lang.Object[] |
getValues()
Returns all values |
int[] |
getVisibleFields()
Retrieves the indices of the, for the user visible fields |
java.lang.Object[] |
getVisibleValues()
Retrieves the values for the visible fields |
protected abstract void |
initializeSettings()
Initialize all user settings on this data crow object |
boolean |
isChanged()
Indicates if changes have been made to this data crow object. |
boolean |
isChanged(int index)
Indicates if changes have been made to the specified value. |
boolean |
isHidden(int index)
Indicates if the given field is visible to the user or not |
boolean |
isRequired(int index)
Indicates whether the given field is required or not |
boolean |
isUnique(DCObject o,
boolean bUpdateQuery)
Checks to see whether the record already exists or not |
void |
load(QueryOptions options,
RequestorCollection requestors)
Loads records. |
void |
saveNew(RequestorCollection requestors)
Inserts a new record. |
void |
saveUpdate(RequestorCollection requestors)
Updates a record. |
static void |
setAlwaysGenerateID(boolean alwaysGenerateID)
Deprecated. |
void |
setChanged(int index,
boolean b)
Marks the specified value as changed (or not) This means that the value will be considered for an insert or update to the database |
protected abstract void |
setModuleIndex()
Sets the module index / sets the ownership of this data crow object |
void |
setSilence(boolean silence)
Disables the output of this query to the log and log screen. |
protected abstract void |
setTableName()
Sets the database table name for this object |
void |
setUIRowNumber(int row)
|
void |
setValidation(boolean validate)
Specifies if values should be validated |
void |
setValue(int index,
java.lang.Object value)
Sets a value for the given field |
void |
setValues(java.lang.Object[] row)
Sets a complete set of values on the object calls setValue for each individual value |
QueryCondition |
toQueryCondition(boolean select)
Creates a query condition for select statements by using the field names and their values |
void |
undoChanges()
Sets all fields to 'unchanged'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int uiRowNumber
protected int module
protected java.util.Vector values
protected boolean bValidation
protected static boolean alwaysGenerateID
protected static final WorkFlow wf
protected java.lang.String sTableName
public static final int _ID
Constructor Detail |
protected DCObject()
Method Detail |
public void setValues(java.lang.Object[] row)
setValue(int, Object)
protected abstract void setModuleIndex()
protected abstract void initializeSettings()
protected abstract void setTableName()
public abstract javax.swing.ImageIcon getIcon()
public DCModule getModule()
public DCFieldDefinition[] getFields()
public void undoChanges()
public boolean isChanged()
public boolean isChanged(int index)
index
- the value index to check onpublic void setChanged(int index, boolean b)
index
- the value index to mark as changed / unchangedb
- changed y/npublic boolean isHidden(int index)
index
- field indexpublic boolean isRequired(int index)
index
- field indexpublic int[] getHiddenFields()
public java.lang.String getID()
public int[] getNotSearchableFields()
public int[] getVisibleFields()
public java.lang.Object[] getVisibleValues()
public static void setAlwaysGenerateID(boolean alwaysGenerateID)
alwaysGenerateID
- public void setValue(int index, java.lang.Object value)
public void clearValues()
public java.lang.String[] getLabels()
public java.lang.String getTableName()
public java.lang.String getLabel(int index)
index
- field indexpublic int[] getMaxFieldLengths()
public int getMaxFieldLength(int index)
index
- field indexpublic java.lang.Object getValue(int index)
public java.lang.Object[] getValues()
public void setUIRowNumber(int row)
public int[] getFieldTypes()
ComponentFactory
public int getFieldType(int index)
ComponentFactory
public java.lang.String[] getDatabaseFieldNames()
public java.lang.String getDatabaseFieldName(int index)
index
- field indexpublic int[] getRequiredFields()
public int[] getReadOnlyFields()
public void saveNew(RequestorCollection requestors)
requestors
- collection of requests (can be null)public void saveUpdate(RequestorCollection requestors)
requestors
- collection of requests (can be null)public void delete(RequestorCollection requestors)
public void load(QueryOptions options, RequestorCollection requestors)
options
- query options, can be nullrequestors
- collection of requests (can be null)public void setSilence(boolean silence)
silence
- show output y/npublic boolean getSilence()
public void setValidation(boolean validate)
validate
- validate values y/npublic QueryCondition toQueryCondition(boolean select)
select
- indicates if this is about a select querypublic DCFieldDefinition getField(int index)
index
- field indexpublic java.lang.String[] getChangedFieldNames()
public java.lang.Object[] getChangedFieldValues()
public boolean checkIntegrity(boolean update)
update
- indicates if the values are new or existingpublic java.lang.String[] getCreateStatements()
public boolean isUnique(DCObject o, boolean bUpdateQuery)
o
- object to be checkedbUpdateQuery
- indicates whether the object is to
be updated or if it is a new objectpublic java.lang.String getUnfilledRequiredFields()
public int[] getFieldIndices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |