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 Cory Prowse <cp...@infocomp.com> on 2005/07/06 06:59:59 UTC

Foriegn Key field not populated when auto-retrieve="false"

G'Day,

Just noticed this behaviour and was hoping there was something simple I
could do to fix it.

I have auto-retrieve set to false on a reference-descriptor, and when I load
from the database the associated field-descriptor for it's foreign key is
not populated.
If I set auto-retrieve to true however it does populate the foreign key,
however this is not a viable option for us.

In the example repository xml below, when the object is loaded from the
database the childId attribute is not populated.
Is there a way to make OJB populate the childId even with the
reference-descriptor not auto retrieving?

We only want the id, not the while object (and proxying the object is not a
viable option either).

    <field-descriptor
	name="childId"
	column="child_id"
	jdbc-type="INTEGER"
	nullable="true"/>
...
    <reference-descriptor
         name="child"
         class-ref="com.package.Child"
         auto-update="true"
         auto-retrieve="false"
         auto-delete="false"
         proxy="false">
         <foreignkey field-ref="childId"/>
    </reference-descriptor>

Cory Prowse
Analyst Programmer
InfoComp
Wollongong, Level 2, 63 Market Street
Phone: +61 (0) 2 4298 9158
email: mailto:cprowse@infocomp.com <ma...@infocomp.com> 
http://www.infocomp.com/ <http://www.infocomp.com/> 


Re: Foriegn Key field not populated when auto-retrieve="false"

Posted by Thomas Dudziak <to...@gmail.com>.
Could you perhaps provide some more info, specifically the complete
class descriptor (or a comparative sample) and your usage of OJB for
storing and retrieving the object ?

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org