Hi,
I am fairly new to JSR 303, Bean validation.
I wish to know how I can use it for validating certain complex conditions, for instance
I have a object:
1. Person (name, age)
2. Account (type, minimumBalance, dailyWithdrawalLimit)
I think we can use JSR 303, to validate Person or Account alone, say
a. person.age must be more than 5.
b. person.name cannot be blank
c. account.type can have only 2 values - 'Savings' or 'Checking'
Is it possible to use JSR 303, for something more complex;
eg.
a. If account.type = 'Savings' then
account.minimumBalance IS $1000/-
account.dailyWithdrawalLimit IS $ 5000/-
but If account.type = 'Current' then
account.minimumBalance IS $ 1.0/-
Is it possible to use JSR 303, alone (nothing else) to validate across objects?
eg. If person.age < 17, then account.type CAN-Only-be 'Savings'
If it is not possible, to use JSR 303 alone, what will I have to use in addition to JSR 303?
Would appreciate if can point me to links/ blogs/ articles, which show case, how such validations are achieved.
thank you
Jeevan