Results 1 to 2 of 2

Thread: Composite unique index with JPA

  1. #1
    Join Date
    May 2010
    Location
    Angolo Terme, BS, Italy
    Posts
    57

    Question Composite unique index with JPA

    Hi everyone.

    I've searched a way to define a composite unique index with JPA.. but I find only solutions to create composite primary key.

    Does someone have suggestions?

    Thank very much!
    Marco

  2. #2
    Join Date
    May 2010
    Location
    Angolo Terme, BS, Italy
    Posts
    57

    Default

    I've solved.

    Just adding this annotation!

    @Table(uniqueConstraints=@UniqueConstraint(columnN ames={"lastName","firstName"}), name="myUniqueConstraint")

    Thank you anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •