velosurf.validation
Class Reference
java.lang.Object
velosurf.validation.FieldConstraint
velosurf.validation.Reference
public class Reference
- extends FieldConstraint
A foreign key constraint. Syntax is:
<column references="table.foreign-key">
or:
<column>
<references foreign-key="table.foreign-key" [message="error-message"]/>
</column>
Note: his constraint is not meant to replace an internal SQL "references" clause in the database,
since it cannot be made sure that complex updates will respect this constraint.
- Author:
- Claude Brisson
|
Constructor Summary |
Reference(Database db,
java.lang.String table,
java.lang.String column)
Constructor. |
|
Method Summary |
java.lang.String |
toString()
|
boolean |
validate(java.lang.Object data)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_db
protected Database _db
_table
protected java.lang.String _table
_column
protected java.lang.String _column
Reference
public Reference(Database db,
java.lang.String table,
java.lang.String column)
- Constructor.
- Parameters:
table - the table namecolumn - the column name
validate
public boolean validate(java.lang.Object data)
- Overrides:
validate in class FieldConstraint
- Parameters:
data - the data to be validated
- Returns:
- true if data respects the specified reference
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
~ooOoo~