Hi,

Regarding the documentation about OpenJPA you can define a unique column
with something like that:

@Entity
@Table(name="ART", [EMAIL PROTECTED](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 <[EMAIL PROTECTED]> 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
>

Reply via email to