openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <>
Subject Re: Unique constraint annotations not generated by Reverse Mapping tool
Date Fri, 07 Dec 2012 20:02:03 GMT
Ahh, thanks for the clarification.  Although Unique Indexes and Unique
Constraints are very similar in function, my guess is OpenJPA is only
recognizing Unique Constraints in the schema.  Then again, it may be that
the Unique Constraints are not recognized at all during the Reverse Mapping
process...  Sorry, I just haven't had direct experience with this use of
the Reverse Mapping.

You could try using Unique Constraints in your schema instead of Unique
Indexes to see if it makes a difference.  Otherwise, you might have to
resort to hand-modifying the Entity java code that is generated.  Opening a
JIRA for this capability would also be a good idea.


On Fri, Dec 7, 2012 at 12:29 PM, anand213 <>wrote:

> Thanks for the response Kevin.
> I was looking for @UniqueConstraint annotation in generated files and the
> tool is reading the unique indexes so i expected it to put annotation for
> the same.
> @Table(name = "EMPLOYEE_FOR_CACHE", uniqueConstraints = {
> @UniqueConstraint(columnNames = { "dept", "project" }),
>                 @UniqueConstraint(columnNames = { "fname", "lname",
> "location" }) })
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message