Hi, All. When I started with Xdoclet, I was most impressed by the way it generated a PK class, when I have declared 2 fields as primary key, and did let it generate the PK class.
I have two classes C1, C2 with String as pk, and one class C3, with relations to
each of the other ones. Its
C1 1:n C3 n:1 C2
The CMR fields of C3 relating it to C1 and C2 are the two primary keys of C3.
Although it worked perfectly, during the development I switched to
C3 having a primary key which I construct from concatenating the keys of C1 and C2:
public String ejbCreate(C1 c1, C2 c2)
throws CreateException
{ String pk = c1.getId()+c2.getId();
setId(pk);
return pk;
}
I cannot make up my mind whether I should switch back to the initial solution, where I have a PK with two fields generated by Xdoclet.
It will certainly be useful to show the advantages of Xdoclet to the management.
Are there as well other reasons to change back to the generated PK class, or is my solution even better?
Please give me an advice, my data-base lectures are 8 years back...
Best, Philipp
----------------------------- Philipp W. Kutter
Dipl. Inf.-Ing. ETH
managing partnerA4M applied formal methods AG
Schlossergasse 1
CH-8001 Zurich
tel. +41 1 260 75 52
fax. +41 1 260 75 51
email kutter @a4m.biz
web http://www.a4m.biz
-----------------------------
This email and any files tran
smitted with it are confident
ial and intended solely for t
he use of the individual or e
ntity to whom they are addres
sed. If you have received thi
s email in error please notif
y the system manager. -----------------------------
smime.p7s
Description: S/MIME Cryptographic Signature
