Hi,
Thanks for reply.
Unfortunately there are no fields.
Unless I'm mistaken, you do not add mutators and accessors for foreign key
fields using CMR (I tried this once and WebLogic complained) - you only have
relations to other objects which themselves have the foreign key tagged. For
example, the last XDoclet tag here would be invalid.
* @weblogic.column-map
* key-column="STAFF_ID"
* foreign-key-column="STAFF_FK"
*
* @jboss.relation
* related-pk-field="staffId"
* fk-column="STAFF_FK"
*
* @ejb.pk-field
*/
public abstract StaffLocal getStaff();
I think this is a comceptual problem, maybe TeamMember needs to extend Staff
and add TeamRole and Team. Hmmmm...
Chris
-=-=-=
-----Original Message-----
From: Gavin Hughes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday 26 November 2002 00:04
To: Shaw, Chris
Subject: RE: [Xdoclet-user] Compound Primary Keys as Foreign Keys
Hi Chris,
Isn't the (implied) primary key for this table the combination
of the 3 fk's that you mention ?
So you need to define a composite PK for the table - this doesn't
need to be defined in the database itself - just in XDoclet - put
@ejb.pk-field tags above each of the getters for the fields that
make up the composite primary key.
HTH.
Gavin.
-----Original Message-----
From: Shaw, Chris [mailto:[EMAIL PROTECTED]]
Sent: Monday, 25 November 2002 9:47 PM
To: [EMAIL PROTECTED]
Subject: [Xdoclet-user] Compound Primary Keys as Foreign Keys
Hi,
How can I map an Entity in XDoclet that contains no primary key fields?
Basically I have inherited a database table with 3 primary keys, each of
which is itself a foreign key.
XDoclet says that the @ejb.pk-field tag must be used with an
@ejb.persistence tag (ie with a field) but you cannot have such a tag on
an association.
The Entity in question is called: TeamMember
a Team Member is uniquely identified by the foreign Key to:
Staff (staff_fk)
Team (team_fk)
TeamRole (team_role_fk)
..a member of Staff can play multiple different TeamRole-s in the same
(or
many) Team-s
-=-=-
I cannot create a new column/attribute (e.g. teamMemberId) and make it
the sole primary key as this would allow a duplicate Staff Member in the
same Team and Team Role (and the DBA's would lynch me).
Chris
-=-=-=
PS - I always use a PK class, so the comound Primary Key is not the
issue, it is the lack of any pk fields.
Any e-mail message from the European Central Bank (ECB) is sent in good
faith but shall neither be binding nor construed as constituting a
commitment by the ECB except where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named
above. Any unauthorised disclosure, use or dissemination, either in
whole or in part, is prohibited. If you have received this e-mail in
error, please notify the sender immediately via e-mail and delete this
e-mail from your system.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user
Any e-mail message from the European Central Bank (ECB) is sent in good faith but
shall neither be binding nor construed as constituting a commitment by the ECB except
where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any
unauthorised disclosure, use or dissemination, either in whole or in part, is
prohibited.
If you have received this e-mail in error, please notify the sender immediately via
e-mail and delete this e-mail from your system.
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user