[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-user
Subject:    [JBoss-user] CMR question: r-table-mapping, with existing tables
From:       Bill Curtis <bill () brenagain ! net>
Date:       2003-03-31 23:18:37
[Download RAW message or body]

hello...

I have an existing table, A, which has a 1..* relationship with itself.

This relationship makes us of an existing mapping table, B.

I have inherited these tables, and unfortunately cannot alter them.

Table A has a meaningless PK, called "oid".

Table A also has a unique, meaningful column which is called "prod_id".

The mapping table maps parent OID's to child PROD_ID's (instead of to child 
OID's, which would be the same).

In the mapping table, the columns are not named OID and PROD_ID.  They are 
called OID and CHILD_PROD_ID.

Given this state of affairs -- is it possible for me to create a container 
managed relationship?

The problems I see are that the mapping table is not very "natural" -- in 
that it maps parent PKs to child non-PKs, and then gives the non-PK 
different names in the mapping table and data table -- so I am unclear as 
to how the relationship-table-mapping and key-fields should be specified in 
jbosscmp-jdbc.

If this IS possible -- can someone explain how I would set up the 
ejb-relationship in jbosscmp-jdbc?  (Specifically, key-fields and 
table-mapping elements).

I could always create a mapping bean, and then implement a 1..1..* 
relationship with foreign key mapping, but I am hoping I can avoid 
that.  (I'm not even certain that can be done-- my first thought is that is 
should be.)

thanks,
--bill




-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic