Hi.
anonymous wrote :
| But in some weird case where my validation require some kind of twisted
logic using some properties from the Person entity and all the other entities
already persisted, is there a clean way to add this logic in the model? Or this
is conceptually wrong?
|
For me,
Thanks 4 the reply Fer!
This works great.
anonymous wrote :
| I don't know what exactly you mean with "without mapping that to the
database"
|
Sorry about that. I want to validate this uniqueness in my models. But is also
great to have then validated in the database to.
But in some weird
I don't know what exactly you mean with "without mapping that to the database",
but anyway I have solved something similar as follows:
| @Entity
| @Table(name = "person", uniqueConstraints = @UniqueConstraint(columnNames =
{"firstname", "lastname"}))
| public class Person {
| @Id