> In other words, I have a table which doesn't have a unique primary
> key but rather a pair of fields that must be unique. How do I make
> a primary key object without having to add another field to the
> database?
The quick answer is yes, you can do this, and you probably want to check
out EJBdoclet. It will create the primary key class (and a lot of the
other EJB code) for you.
http://sourceforge.net/projects/ejbdoclet/
Not to pick a nit but you *do* in fact have a primary key, it's just
composed of the two columns which together are unique, e.g.:
CREATE TABLE "text_data" (
"text_data" int4 NOT NULL,
"language" int4 NOT NULL,
"text" character varying(255),
PRIMARY KEY ("text_data", "language")
);
With this table you can have multiple rows for each text_data value and
multiple rows for each language value, but only one row for each
text-data/language pair.
HTH,
Toby
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user