I've got a puzzling problem.  I have 3 tables, tbb_activity (A),
tbl_activity_participant (B), and tbb_person_name (C).  The relationship is
1:M from A->B, and 1:M from B->C (basically it's a M:N but there's some
other stuff I'm leaving out).  When I populate the references for B into an
object for table A things work properly.  However when I attempt to populate
references for C into an object for table B it pulls the foreign key from B
(activity_id) and the first of the primary keys (partcipant_id) from B.  But
it names in the log are the proper names, it's just the values which are
incorrect.  The object for B has the proper values, but it appears that OJB
is accessing the wrong fields.  Can anyone give me any idea what's
happening?  I've attached a trimmed version of my repository.xml and the
relevant section of my log.  The log is altered to remove the extra columns
and annotated slightly.  The log shows attempts to retrieve two records
which are related to the tbl_activity_participant record which as already
been retrieved.

        <class-descriptor class="com.cdi.scsd.rad.rms.bean.TbbActivity"
table="tbb_activity">
                <field-descriptor name="activityId" column="Activity_ID"
jdbc-type="INTEGER" access="readonly" primarykey="true"/>
                <collection-descriptor name="activityParticipants"
element-class-ref="com.cdi.scsd.rad.rms.bean.TblActivityParticipant"
proxy="true">
                        <inverse-foreignkey field-ref="activityId"/>
                </collection-descriptor>
        </class-descriptor>

        <class-descriptor
class="com.cdi.scsd.rad.rms.bean.TblActivityParticipant"
table="tbl_activity_participant">
                <field-descriptor name="activityId" column="Activity_ID"
jdbc-type="INTEGER"/>
                <field-descriptor name="participantId"
column="Participant_ID" jdbc-type="INTEGER" primarykey="true"/>
                <field-descriptor name="instanceId" column="Instance_ID"
jdbc-type="INTEGER" primarykey="true"/>
                <collection-descriptor name="personNames"
element-class-ref="com.cdi.scsd.rad.rms.bean.TbbPersonName" proxy="true">
                        <inverse-foreignkey field-ref="participantId"/>
                        <inverse-foreignkey field-ref="instanceId"/>
                </collection-descriptor>
        </class-descriptor>

        <class-descriptor class="com.cdi.scsd.rad.rms.bean.TbbPersonName"
table="tbb_person_name">
                <field-descriptor name="participantId"
column="Participant_ID" jdbc-type="INTEGER"/>
                <field-descriptor name="instanceId" column="Instance_ID"
jdbc-type="INTEGER"/>
                <field-descriptor name="nameId" column="Name_ID"
jdbc-type="INTEGER" primarykey="true"/>
        </class-descriptor>

DEBUG: main: Participant Type: VIC   ActId(fk): 64805 PartId(pk): 42066
InstanceId(pk): 1
DEBUG: [ojb]: executeQuery : QueryByCriteria from class
com.cdi.scsd.rad.rms.bean.TbbPersonName  where [participantId = 64805,
instanceId = 42066]
DEBUG: [ojb]: SQL:SELECT A0.Instance_ID,A0.Name_ID,A0.Participant_ID FROM
tbb_person_name A0 WHERE (A0.Participant_ID = ?) AND A0.Instance_ID = ?
DEBUG: main: Participant Type: SUS   ActId(fk): 64805 PartId(pk): 42067
InstanceId(pk): 1
DEBUG: [ojb]: executeQuery : QueryByCriteria from class
com.cdi.scsd.rad.rms.bean.TbbPersonName  where [participantId = 64805,
instanceId = 42067]
DEBUG: [ojb]: SQL:SELECT A0.Instance_ID,A0.Name_ID,A0.Participant_ID FROM
tbb_person_name A0 WHERE (A0.Participant_ID = ?) AND A0.Instance_ID = ?

--mikej
-=-----
mike jackson
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to