|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.validation.FieldConstraint velosurf.validation.Reference
public class Reference
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.
Field Summary | |
---|---|
private java.lang.String |
column
column |
private Database |
db
database |
private java.lang.String |
table
table |
Constructor Summary | |
---|---|
Reference(Database db,
java.lang.String table,
java.lang.String column)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
toString()
return a string representation for this constraint. |
boolean |
validate(java.lang.Object data)
Validate data against this constraint. |
Methods inherited from class velosurf.validation.FieldConstraint |
---|
getMessage, setMessage, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Database db
private java.lang.String table
private java.lang.String column
Constructor Detail |
---|
public Reference(Database db, java.lang.String table, java.lang.String column)
table
- the table namecolumn
- the column nameMethod Detail |
---|
public boolean validate(java.lang.Object data)
validate
in class FieldConstraint
data
- the data to be validated
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |