hi edson,

this may help, but afaik a proxy is always converted into a real object before assertFkAssignment() is called.
see store()


// ProxyObjects only have to be updated if their real subjects have been loaded
obj = ProxyHelper.getRealObjectIfMaterialized(obj);


jakob

Edson Carlos Ericksson Richter wrote:

I trying some advanced config in my app, and I've found same problem. Appear
that AssertFkAssignment is missing converting Proxy to Objects.

I've tried to change the line

fld.getPersistentField().set(obj, refPkValues[i]);

to


fld.getPersistentField().set(ProxyHelper.getRealObject(obj), refPkValues[i]);

in PersistenceBrokerImpl (line 737 in CVS HEAD). Now work for me, without
changing behaviour in rest of my app.

Jakob, Thomas, can you verify/confirm that? And if yes, can you fix this in
CVS?

Thanks,

Edson Richter




----- Original Message ----- From: "Marcus Breese" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 6:04 PM
Subject: Dynamic proxies and references Help




Is it possible to have recursive references while using a dynamic proxy?

For example, I have a Project class where each project can track its
parent project.

The class is laid out as such:

Project
|- id
|- name
|- parentid
|- parentidObject

Project has an interface IProject.  Also, Id, Name and parentid are
inherited from a base class.

I can retrieve the Project fine via a dynamic proxy, but when I try to
get the parentIdObject, I get the following error:

13:52:49,838 - ERROR
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl -
while set field:
object class[ edu.iupui.cmg.labratj.om.Project
target field: parentIdObject
target field type: interface edu.iupui.cmg.labratj.om.IProject
object value class: $Proxy5
object value: Name: Test Project
Id: 1
PiId: 1
]

Can anyone see where I'm going wrong?

-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese                            [EMAIL PROTECTED]
IU School of Medicine              [EMAIL PROTECTED]
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab


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




--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.495 / Virus Database: 294 - Release Date: 30/6/2003


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






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



Reply via email to