openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Polliard <>
Subject Question about Unique Contraint
Date Wed, 20 Jan 2010 02:50:23 GMT
public class Account {
	private Integer Id = null;
	private String accountName = null;
	private Date creationDate = null;
	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.



Doesn't appear to be the proper Annotation.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message