Hi,
I have a Groups table, which contains name and users id who has defined this group.
However, the same user can define one and only one group with the same name. This way I need to define a contstraint that combination of name and user_id should be unique i.e multiple entries with same name and user id should not be allowed.
i.e in groups table
name --> user id
family --> 10
family --> 11
should be allowed but not
family --> 10
family --> 10
should not be allowed.
Could any one tell me the way to use the annotations in group class so that such contrants are taken care. I appricate JPA approach if possible else hibernate specific approach is also fine.
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com