|
|||||||||
| Home >> All >> javatools >> [ db overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javatools.db
Class DbDynamicConstraint

java.lang.Objectjavatools.db.DbConstraint
javatools.db.DbDynamicConstraint
- public class DbDynamicConstraint
- extends DbConstraint
It is a class representing a "dynamic" constraint, i.e. a constraint that changes references dynamically.
- Version:
- 0.2.0
| Field Summary | |
private boolean |
automaticBuild
|
private java.util.LinkedList |
deleteOperations
|
private java.util.LinkedList |
fatherTables
|
private java.util.LinkedList |
fatherTablesColumns
|
private java.util.LinkedList |
refColumns
|
private java.util.LinkedList |
sonIndexes
|
private java.util.LinkedList |
sonTables
|
private java.util.LinkedList |
updateOperations
|
| Fields inherited from class javatools.db.DbConstraint |
automaticChecking, canDoUpdate, CASCADE, cloned, constraintEmulation, constraints, currentOperation, defaultValues, DELETE_OPERATION, deleteCascadeChildren, DO_NOTHING, fatherColsChildren, fatherRecords, fromList, INSERT_OPERATION, intoList, refColsChildren, refs, searchSets, selector, SET_DEFAULT, SET_NULL, sonsWhere, table, UPDATE_CASCADE, UPDATE_OPERATION, updateCascadeChildren, updateFromLists, updateIntoLists, where |
| Constructor Summary | |
DbDynamicConstraint(DbAbstractTable tbl)
Creates new DbDynamicConstraint |
|
| Method Summary | |
void |
addFatherTable(DbAbstractTable fatherTable,
DbColumn[] fatherColumns,
DbColumn[] pRefColumns,
int updateOperation,
int deleteOperation)
Adds a new father table. |
void |
addSonTable(DbAbstractTable sonTable,
int fatherIndex)
Adds a son table. |
void |
build()
Builds all static lists. |
private void |
buildArrays()
|
void |
check(int operation)
Performs checking in the table, after setting all dynamic and "static" data. |
protected void |
checkFathers()
Checks the fathers. |
protected void |
checkThis(int operation)
Performs base checking. |
private void |
createReferences()
|
java.lang.Object[] |
getDefaultValues(int index)
Returns the default values of referenced father table whose index is specified. |
int |
getDeleteOperation(int index)
Returns the delete operation that should be done for the father table whose index is specified. |
DbColumn[] |
getFatherColumns(int index)
The referenced columns of father table whose index is specified. |
DbAbstractTable |
getFatherTable(int index)
Returns a father table whose index is specified. |
int |
getFatherTablesCount()
Returns the number of referenced father tables. |
DbColumn[] |
getRefColumns(int index)
Returns the referencing columns of THIS table to the father table whose index is specified. |
int |
getSonFatherIndex(int index)
Returns the index that a son table uses to reference this table. |
DbAbstractTable |
getSonTable(int index)
Returns a son table whose index is specified. |
int |
getSonTablesCount()
Returns the number of son tables. |
int |
getUpdateOperation(int index)
Returns the update operation that should be done for the father table whose index is specified. |
void |
setAutomaticBuild(boolean value)
Tells this object to build (or not) automatically all lists at all times. |
int |
update(int operation)
Performs actual update in the table and, eventually, cascades. |
| Methods inherited from class javatools.db.DbConstraint |
checkChildren, clear, clone, getAutomaticChecking, getConstraintEmulation, getTable, initLists, initStaticLists, setAutomaticChecking, setConstraintEmulation, setSelector, setValueLists, setWhere, updateThis |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
fatherTables
private java.util.LinkedList fatherTables
sonTables
private java.util.LinkedList sonTables
updateOperations
private java.util.LinkedList updateOperations
deleteOperations
private java.util.LinkedList deleteOperations
fatherTablesColumns
private java.util.LinkedList fatherTablesColumns
refColumns
private java.util.LinkedList refColumns
sonIndexes
private java.util.LinkedList sonIndexes
automaticBuild
private boolean automaticBuild
| Constructor Detail |
DbDynamicConstraint
public DbDynamicConstraint(DbAbstractTable tbl)
- Creates new DbDynamicConstraint
| Method Detail |
check
public void check(int operation)
throws DbException
- Performs checking in the table, after setting all dynamic and "static" data.
- Specified by:
checkin classDbConstraint
update
public int update(int operation)
throws DbException
- Performs actual update in the table and, eventually, cascades. If automatic
checking is set, it also checks before updating.
- Specified by:
updatein classDbConstraint
addFatherTable
public void addFatherTable(DbAbstractTable fatherTable, DbColumn[] fatherColumns, DbColumn[] pRefColumns, int updateOperation, int deleteOperation)
- Adds a new father table.
addSonTable
public void addSonTable(DbAbstractTable sonTable, int fatherIndex)
- Adds a son table.
getFatherTablesCount
public int getFatherTablesCount()
- Returns the number of referenced father tables.
- Overrides:
getFatherTablesCountin classDbConstraint
getSonTablesCount
public int getSonTablesCount()
- Returns the number of son tables.
- Overrides:
getSonTablesCountin classDbConstraint
getFatherTable
public DbAbstractTable getFatherTable(int index) throws DbException
- Returns a father table whose index is specified.
- Overrides:
getFatherTablein classDbConstraint
getSonTable
public DbAbstractTable getSonTable(int index) throws DbException
- Returns a son table whose index is specified.
- Overrides:
getSonTablein classDbConstraint
getSonFatherIndex
public int getSonFatherIndex(int index)
throws DbException
- Returns the index that a son table uses to reference this table.
- Overrides:
getSonFatherIndexin classDbConstraint
getUpdateOperation
public int getUpdateOperation(int index)
throws DbException
- Returns the update operation that should be done for the father table whose
index is specified.
- Overrides:
getUpdateOperationin classDbConstraint
getDeleteOperation
public int getDeleteOperation(int index)
throws DbException
- Returns the delete operation that should be done for the father table whose
index is specified.
- Overrides:
getDeleteOperationin classDbConstraint
getFatherColumns
public DbColumn[] getFatherColumns(int index) throws DbException
- The referenced columns of father table whose index is specified.
- Overrides:
getFatherColumnsin classDbConstraint
getRefColumns
public DbColumn[] getRefColumns(int index) throws DbException
- Returns the referencing columns of THIS table to the father table whose index
is specified.
- Overrides:
getRefColumnsin classDbConstraint
setAutomaticBuild
public void setAutomaticBuild(boolean value)
- Tells this object to build (or not) automatically all lists at all times.
build
public void build()
throws DbException
- Builds all static lists.
- Overrides:
buildin classDbConstraint
checkThis
protected void checkThis(int operation)
throws DbException
- Performs base checking.
- Overrides:
checkThisin classDbConstraint
checkFathers
protected void checkFathers()
throws DbException
- Checks the fathers.
- Overrides:
checkFathersin classDbConstraint
createReferences
private void createReferences()
getDefaultValues
public java.lang.Object[] getDefaultValues(int index) throws DbException
- Returns the default values of referenced father table whose index is specified.
- Overrides:
getDefaultValuesin classDbConstraint
buildArrays
private void buildArrays()
|
|||||||||
| Home >> All >> javatools >> [ db overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC