0

I want to add some annotation in order to create a unique constraint in one on my entities. I have a entity A where I have two foreign keys to B and C, from A to B and C the relationship is ManyToOne. I want to create a unique constraint in A for B and C. In here and google I could just found example about how to create unique constraint for A and B or A and C.

Any idea how to achieve this?

DavidPostill
  • 7,734
  • 9
  • 41
  • 60
paul
  • 12,873
  • 23
  • 91
  • 153
  • You want a unique constraint on `B` and another on `C`, or a single one on `B+C`? – sp00m Jul 31 '14 at 07:47
  • possible duplicate of [Creating a composite Unique constraints on multiple columns](http://stackoverflow.com/questions/8245935/creating-a-composite-unique-constraints-on-multiple-columns) – Tobb Jul 31 '14 at 07:53

0 Answers0