Hey,
I'm having a problem with a 1:M load. When I load on an object which has
dependants, via a Castor query, I get the following exception
java.sql.SQLException: ORA-00904: invalid column name
This occurs when I attempt to iterate the QueryResult object using
hasMoreElements().
Now here is the strange thing, I have the following mappings: -
<class
name="com.spirentsystems.framework.domainobjects.businessobjects.Part"
identity="oid" key-generator="UUID" access="db-locked">
<description>Part</description>
<cache-type type="none" />
<map-to table="part"/>
<field name="oid" type="string">
<sql name="oid" type="varchar" />
</field>
<field name="PartNo" type="string">
<sql name="partno" type="varchar" />
</field>
<field name="description" type="string">
<sql name="description" type="varchar" />
</field>
<field name="InventoryClass" type="string">
<sql name="inventoryclass" type="varchar" />
</field>
<field name="items" collection="arraylist"
type="com.spirentsystems.framework.domainobjects.businessobjects.Item"
required="false" lazy="false">
<sql many-key="part_fk" />
</field>
</class>
<class
name="com.spirentsystems.framework.domainobjects.businessobjects.Item"
depends="com.spirentsystems.framework.domainobjects.businessobjects.Part"
identity="oid" key-generator="UUID" access="db-locked">
<description>Item</description>
<cache-type type="none" />
<map-to table="item" />
<field name="oid" type="string">
<sql name="oid" type="varchar" />
</field>
<field name="ItemId" type="string">
<sql name="itemid" type="varchar" />
</field>
<field name="part"
type="com.spirentsystems.framework.domainobjects.businessobjects.Part">
<sql name="part_fk" />
</field>
<field name="serial" type="string">
<sql name="serial" type="varchar" />
</field>
<field name="status" type="string">
<sql name="status" type="varchar" />
</field>
<field name="favorite"
type="com.spirentsystems.framework.domainobjects.businessobjects.Favorite">
<sql name="favourite_id" />
</field>
<field name="BinLocation"
type="com.spirentsystems.framework.domainobjects.businessobjects.BinLocation
">
<sql name="binlocation_id" />
</field>
<field name="UserToolboxItems"
type="com.spirentsystems.framework.domainobjects.businessobjects.UserToolbox
Items">
<sql name="usertoolboxitems_id" />
</field>
<field name="BookingLineList" collection="arraylist"
type="com.spirentsystems.framework.domainobjects.businessobjects.BookingLine
" required="false" lazy="false">
<sql many-key="item_fk" />
</field>
<field name="CheckOutList" collection="arraylist"
type="com.spirentsystems.framework.domainobjects.businessobjects.CheckOut"
required="false" lazy="false">
<sql many-key="item_fk" />
</field>
<field name="ItemHistories" collection="arraylist"
type="com.spirentsystems.framework.domainobjects.businessobjects.ItemHistory
" required="false" lazy="false">
<sql many-key="item_fk" />
</field>
</class>
The Part definition refers to a collection of Item objects. The Part
references the foreign key part_fk, and Item has a reference back to its
parent Item object via its own reference via the part_id field in the
database. Now, this will "work", i.e. I won't get the error, but then again,
because of a bug in Castor, the part_fk field won't be populated, and then I
can't load the Item objects anyway. But, if I change the Part reference in
Item to part_fk, then the error above occurs.
I do this on another set of my objects, and they load fine, but in this case
they aren't.
The objects are being created fine, but its reading them back is the
problem.
Any suggestions would be greatly appreciated. Thanks,
Glenn.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev