public class Account {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer Id = null;
@Unique
private String accountName = null;
@Basic
private Date creationDate = null;
@ManyToMany(cascade=CascadeType.ALL)
private List<Host> hostList = new ArrayList<Host>();
However, in the database it actually doesn't restrict the accountName but
rather forces a new ID to be generated with the same accountName. What page can
I find out about creating a Unique constraint that mimics this in pseudo
database ddl
create table Account (
Id int4 PRIMARY KEY,
accountname varchar(255) NOT NULL UNIQUE,
.....
Thanks for the assistance.
Thomas
PS:
http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/ref_guide_mapping_jpa.html#ref_guide_mapping_jpa_unique
Doesn't appear to be the proper Annotation.