java - Multiple unique constraints in JPA -


Is there any way to specify using the Jpea that there should be many unique obstacles on the set of different columns?

@inti @Table (name = "person", exclusive conferences = @ unique conference (columnNames = { "Code", "uid"})) Public class individuals {// unique code and UID public string code; Public string UID; // username string user name unique on username; The name of the public string; Public string email; }

I have seen a hibernate specific annotation but I am trying to avoid vendor-specific solutions because we are still deciding between hibernate and datonucleus.

@Table attribute of uniqueConstraints actually One of these array accepts that your example is just a short story for an array with an element. Anyway it will look like this:

  @Table (name = "person", uniqueConstraints = {@UniqueConstraints (columnNames = {"code", "uid"}), @UniqueConstraint (columnNames = {when Even the unique obstacle is based on one field, you can use  @Column (unique = true)     on that column 


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -