You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Ken Dempster <kd...@visionsolutions.com> on 2003/05/30 18:37:52 UTC

Limited collection returned

Most everything works except I only get one out of the know four row
objects from the table in my collection.  I want to get all the row
objects in the table.  My question is why am I only getting only one row
object?  I am not sure what I am doing something wrong.    
 
Here is how I have things setup.  I have set jboss 3.2 as suggested in
the deployment section of the documentation and have jboss configured it
with data source to connect to a DB2 database.  I am requesting a
collection from a client to a SessionBean that delegates to a
PersistenceBroker instance.   Basicly I am using the code in
PersistenceBrokerBean as a template for my EJB.  I do generate my own
JdbcConnectionDescriptor and pass it to the ConnectionRepository instead
of using the repository.xml to define my JdbcConnectionDescriptor.  
 
My query looks as follows:
Query query = new QueryByCriteria(Runner.class, null);

Collection list =
getPersistenceBrokerRemote().getCollectionByQuery(query);

 
My ClassDescriptor of the collection of objects I am trying to get is
defined in the repository_user.xml as follows :
 
<class-descriptor class="test.ojb.Runner" table="KENLIB.RUNNER">

<field-descriptor name="m_id" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>

<field-descriptor name="m_name" column="NAME" jdbc-type="VARCHAR"/>

<collection-descriptor name="m_times" element-class-ref="test.ojb.Time">

<inverse-foreignkey field-ref="m_id"/>

</collection-descriptor>

</class-descriptor>

<class-descriptor class="test.ojb.Race" table="KENLIB.RACE">

<field-descriptor name="m_id" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>

<field-descriptor name="m_location" column="LOCATION"
jdbc-type="VARCHAR"/>

<field-descriptor name="m_date" column="DATE" jdbc-type="DATE"/>

</class-descriptor>

<class-descriptor class="test.ojb.Time" table="KENLIB.RACE_TIME">

<field-descriptor name="m_id" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>

<field-descriptor name="m_runner_id" column="RUNNER_ID"
jdbc-type="INTEGER"/>

<field-descriptor name="m_race_id" column="RACE_ID"
jdbc-type="INTEGER"/>

<field-descriptor name="m_time" column="TIME" jdbc-type="VARCHAR"/>

<reference-descriptor name="m_race" class-ref="test.ojb.Race">

<foreignkey field-ref="m_race_id"/>

</reference-descriptor>

</class-descriptor>

 


Ken Dempster
Programmer Analyst
Vision Solutions, Inc.

17911 Von Karman Ave,  5th Floor
Irvine, CA 92614
UNITED STATES

Tel: +1 (949) 253-6500
Fax: +1 (949) 253-6501
Email: kdempster@visionsolutions.com
<http://www.visionsolutions.com/>
Disclaimer - 5/30/2003
The contents of this e-mail (and any attachments) are confidential, may be privileged, and may contain copyright material of Vision Solutions, Inc. or third parties. You may only reproduce or distribute the material if you are expressly authorized by Vision Solutions to do so. If you are not the intended recipient, any use, disclosure or copying of this e-mail (and any attachments) is unauthorized. If you have received this e-mail in error, please immediately delete it and any copies of it from your system and notify us via e-mail at helpdesk@visionsolutions.com