Solved.
The problem was with a dangling OQLQuery object.
It was garbage collected during iteration on the QueryResults.
Alex.
-----Original Message-----
From: Alex Grivnin
Sent: Wednesday, March 13, 2002 7:50 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Selection problem
Hi,
I'm trying to select all class objects using the following OQL: "SELECT d FROM
Device d"
But the selection does not bring all existing in the database objects.
If someone knows what could be the problem PLEASE, PLEASE let me know.
Thanks in advance,
Alex Grivnin
Here are the classes:
// Device has a single device type, while DeviceTypes contain all associated Devices.
class Device
{
private DeviceType devType;
...
}
class DeviceType
{
private ArrayList deviceList;
...
}
Here is the mapping fragment:
<class name="Device" identity="id" access="shared" key-generator="MAX">
<cache-type type="count-limited"/>
<map-to table="device" xml="device"/>
<field name="id" type="integer" required="false" transient="false"
direct="false" get-method="getId" set-method="setId">
<sql name="id" type="integer" dirty="check" read-only="false"/>
<bind-xml name="id" type="integer" matches="" node="attribute"/>
</field>
<field name="deviceType" type="DeviceType" lazy="false" required="false"
transient="false" direct="false" collection="arraylist">
<sql name="device_type_id" dirty="check" read-only="false"/>
<bind-xml name="device_type_ref" type="DeviceType" matches=""
node="element"/>
</field>
...
</class>
<class name="DeviceType" identity="id" access="shared" key-generator="MAX">
<cache-type type="count-limited"/>
<map-to table="deviceType" xml="device_type"/>
<field name="id" type="integer" required="false" transient="false"
direct="false" get-method="getId" set-method="setId">
<sql name="id" type="integer" dirty="check" read-only="false"/>
<bind-xml name="id" type="integer" matches="" node="attribute"/>
</field>
<field name="device" type="Device" lazy="false" required="false"
transient="false" direct="false" collection="arraylist">
<sql many-key="device_type_id" dirty="check" read-only="false"/>
<bind-xml name="device_ref" type="Device" matches="" node="element"/>
</field>
...
</class>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev