I have a class called Iteraction this iteration have many fields in special i want do a validation of uniqueness for three fields together (startDate, endDate and Project), Project is a class.
I try do something like that:
@Table(uniqueConstraints = {@UniqueConstraint(columnNames={"startDate", "endDate", "project_id"})})
But dont work, what a want say to my validation is: i can only have ONE register of iteration in database with the same startDade, endDate and project_id:
In Rails Code i can use Scope for that, but using hibernate i don't know how, can someone help me?