|
||||||||||
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 items. Objects which extend this class need to override the save and load methods
Field Summary | |
static int |
_ID
|
static int |
_SYS_MODULE
|
protected java.util.Collection |
alChildren
|
protected static boolean |
alwaysGenerateID
|
protected boolean |
bValidation
Indicates of the data should be checked for validity |
protected int |
module
|
protected int |
uiRowNumber
|
protected java.util.Map |
values
|
Constructor Summary | |
protected |
DcObject()
Creates an empty data crow object |
Method Summary | |
void |
addChild(DcObject child)
Adds a child to this object |
void |
addChildren(java.util.Collection children)
|
void |
addRequest(IRequest request)
Add a requestor. |
void |
applySettings(DcFieldDefinitions definitions)
Initialize all user settings on this data crow object |
void |
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()
|
void |
finalize()
|
java.lang.String[] |
getChangedFields()
Returns the labels of the fields that have been marked as changed |
java.util.Collection |
getChildren()
Retrieve all children of this object |
java.lang.String |
getDatabaseFieldName(int index)
Returns the database field name for the given field |
int[] |
getDisabledFields()
Retrieves all disabled fields |
java.lang.String |
getDisplayString(int index)
|
DcField |
getField(int index)
Returns the field definition object for the given field index |
int[] |
getFieldIndices()
Returns all field indices |
java.util.Collection |
getFields()
Returns all the field definitions. |
int |
getFieldType(int index)
Returns the UI field type for the given field |
abstract java.lang.String |
getFilename()
Returns the filename |
java.util.Collection |
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)
|
int |
getMaxFieldLength(int index)
Retrieves the maximum length for the given field |
DCModule |
getModule()
Returns the module to which this object belongs. |
java.util.Collection |
getNotSearchableFields()
Retrieves all fields on which a search cannot be performed. |
int |
getParentReferenceFieldIndex()
Retrieve the field index holding the reference to the parent (the primary key of the parent) |
RequestCollection |
getRequests()
Returns all requestors |
int |
getRow()
|
boolean |
getSilence()
Indicates if queries should display output |
java.lang.String |
getTableJoin()
|
java.lang.String |
getTableName()
|
java.lang.String |
getTableShortName()
|
java.lang.Object |
getValue(int index)
Returns the value of a field |
protected DcValue |
getValueDef(int index)
Retrieves the value for the given field index |
java.util.Collection |
getVisibleFields()
Retrieves the indices of the, for the user visible fields |
boolean |
isBatch()
Part of a batch ? |
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 |
isEnabled(int index)
Indicates if the given field is visible to the user or not |
boolean |
isEndOfBatch()
End of the batch ? |
boolean |
isRequired(int index)
Indicates whether the given field is required or not |
boolean |
isSearchable(int index)
Indicates whether the given field is required or not |
void |
isUnique(DcObject o,
boolean bUpdateQuery)
Checks to see whether the item already exists or not |
void |
load(QueryOptions options)
Loads items. |
void |
markAsUnchanged()
Sets all fields to 'unchanged'. |
void |
reload()
|
void |
removeChildren()
Remove all children from this object |
void |
removeRequestors()
Remove all requestors listening in on this object |
void |
saveNew()
Inserts a new item. |
void |
saveUpdate()
Updates an item. |
void |
setBatch(boolean batch)
Indicates this object being part of a larger operation |
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 |
void |
setChildren(java.util.Collection children)
|
void |
setEndOfBatch(boolean end)
Indicates this object to be the last in row of an update / insert or delete |
void |
setIDs()
Apply the IDs on this object and its children |
protected abstract void |
setModuleIndex()
Sets the module index / sets the ownership of this data crow object |
void |
setRow(int row)
|
void |
setSilence(boolean silence)
Disables the output of this query to the log and log screen. |
void |
setValidation(boolean validate)
Specifies if values should be validated |
void |
setValue(int index,
java.lang.Object o)
Sets a value for the given field |
void |
setValueForColumn(java.lang.String column,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int uiRowNumber
protected int module
protected java.util.Map values
protected boolean bValidation
protected static boolean alwaysGenerateID
protected java.util.Collection alChildren
public static final int _ID
public static final int _SYS_MODULE
Constructor Detail |
protected DcObject()
Method Detail |
public void removeRequestors()
public void setValueForColumn(java.lang.String column, java.lang.Object value)
public RequestCollection getRequests()
public java.lang.String getTableName()
public java.lang.String getTableShortName()
public java.lang.String getTableJoin()
public java.lang.String getLabel(int index)
public void addRequest(IRequest request)
public void setEndOfBatch(boolean end)
end
- public void setBatch(boolean batch)
batch
- part of batch y/npublic boolean isBatch()
public boolean isEndOfBatch()
public void removeChildren()
public void setChildren(java.util.Collection children)
public void addChildren(java.util.Collection children)
public void addChild(DcObject child)
child
- public java.util.Collection getChildren()
public int getParentReferenceFieldIndex()
public abstract javax.swing.ImageIcon getIcon()
public abstract java.lang.String getFilename()
public DCModule getModule()
public java.util.Collection getFields()
public void markAsUnchanged()
public void reload()
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 isEnabled(int index)
index
- field indexpublic boolean isRequired(int index)
index
- field indexpublic boolean isSearchable(int index)
index
- field indexpublic int[] getDisabledFields()
public java.util.Collection getHiddenFields()
public java.lang.String getID()
public java.util.Collection getNotSearchableFields()
public java.util.Collection getVisibleFields()
public void setValue(int index, java.lang.Object o)
public void clearValues()
public int getMaxFieldLength(int index)
index
- field indexpublic java.lang.Object getValue(int index)
public java.lang.String getDisplayString(int index)
public void setRow(int row)
public int getRow()
public int getFieldType(int index)
ComponentFactory
public java.lang.String getDatabaseFieldName(int index)
index
- field indexpublic void saveNew() throws ValidationException
ValidationException
public void saveUpdate() throws ValidationException
ValidationException
public void delete()
public void load(QueryOptions options)
options
- query options, can be nullpublic void setSilence(boolean silence)
silence
- show output y/npublic boolean getSilence()
public void setValidation(boolean validate)
validate
- validate values y/npublic DcField getField(int index)
index
- field indexpublic java.lang.String[] getChangedFields()
public void checkIntegrity(boolean update) throws ValidationException
update
- indicates if the values are new or existing
ValidationException
public void isUnique(DcObject o, boolean bUpdateQuery) throws ValidationException
o
- object to be checkedbUpdateQuery
- indicates whether the object is to
be updated or if it is a new object
ValidationException
public int[] getFieldIndices()
protected abstract void setModuleIndex()
public void applySettings(DcFieldDefinitions definitions)
public void setIDs()
protected DcValue getValueDef(int index)
index
- field indexpublic void finalize() throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |