This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello - I finally got the no-id-field thing figured out (found someone with access to the Oracle database and he created a view with a dummy surrogate ID field) but I'm now having problems materializing a target entity in a one-to-one association. I have attached the model project (IqmsModel.zip) and the code that uses it (IqmsOrderItemData.zip). The offending entity is called PceVBomOpmat - yeah I know, even the name is somewhat offensive, eh? Anyway, here is the code that fails:
On the seventh line, op.OpmatArinvt is always null. The foreign key field that references it is NOT null, so I don't understand why the target entity is not being materialized. Any thoughts? Thanks, Dave |
|
|
OK so I see I got no replies yesterday. Is that because I didn't explain the problem well enough, is the example code not sufficient to demonstrate it, is everyone too busy to answer or is it truly a stumper? Just askin'... Dave |
|
|
So here's what I had to do to get it to work:
That's downright ugly... It's also slow. But it works, and I can't get it to work without manually looking up the entity using the entity ID. Ugh. Any ideas from the other side of the world? |
|
|
Turn off the eager load between Arinvt and PceVBomOpmat - that appeared to work at the cost of the additional queries. Let me know if you see the same result. I believe the PceVBomOpmat instance believes it has already eager loaded its Arinvt counterpart but in fact it hasn't.
|
|
|
Well that won't be any less efficient than what I'm currently doing to make it work. A lot more elegant, too. I have a full morning but I will definitely give that a try. Oh wait. You all won't be in (tomorrow) until 2 or 3 PM here today... :) I'll let you know. |
|
|
This solution seems to do the trick. I'm not terribly concerned with the time involved for the extra queries at this point as the volume is pretty low, so this resolves the issue for now. Thanks for the feedback! Dave |
|