openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: @UniqueConstraint annotation
Date Tue, 28 Aug 2007 15:42:05 GMT
Hi,

I think that this is actually a limitation of OpenJPA currently --
OpenJPA ignores unique constraints and some (most?) index definitions
when generating a schema.

Could you attach the full stack trace to
https://issues.apache.org/jira/browse/OPENJPA-340 please? It'll be
useful for resolving the issue.

-Patrick

On 8/28/07, Ignacio Andreu <plunchete@gmail.com> wrote:
> Hi,
>
> Regarding the documentation about OpenJPA you can define a unique column
> with something like that:
>
> @Entity
> @Table(name="ART", uniqueConstraints=@Unique(columnNames="TITLE"))
> public class Article {
>     ...
> }
>
> And in XML
>
> <entity class="org.mag.Article">
>     <table name="ART">
>         <unique-constraint>
>             <column-name>TITLE</column-name>
>         </unique-constraint>
>     </table>
>     ...
> </entity>
>
> For more information see the "Unique Constraints" section [1]
>
> - Ignacio
>
>
> [1]
> http://openjpa.apache.org/docs/latest/manual/manual.html#jpa_overview_mapping_unq
>
> On 8/28/07, ben short <jamin.short@gmail.com> wrote:
> >
> > Hi,
> >
> > I am trying to use the @UniqueConstraint annotation but get the
> > following error message..
> >
> > OpenJPA does not yet support the @UniqueConstraint annotation.
> >
> > Is that any plan to implement this feature in the near future? Can I
> > define the mapping for the class that I'm trying to annotate in xml
> > rather than use the annotations to use the UniqueConstraint feature?
> >
> > Regards
> >
> > Ben Short
> >
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message