This one time, at band camp, Schramm, Rich said:
SR>I have class DataProducer which contains a reference to class Person as 'contact'.
SR>Also have class Deployment that extends DataProducer which has a reference to a
class Device
SR>
SR>I am only to able to update a DataProducer instance's 'contact' field, but only if
I queried it as a Deployment and then upcast
SR>it to a DataProducer.
SR>
SR>If Ive OQL'd for a DataProducer that happens to also be a Deployment, I get errors
as below...
SR>
SR>>>>[java] org.exolab.castor.jdo.DataObjectAccessException: Type conversion error:
could not set null to FieldMolder of myapp.Deployment.setdevice(myapp.Device device)
SR>>>>
SR>>>>[java] [ssds_test] org.exolab.castor.jdo.TransactionAbortedException: Nested
error: java.lang.IllegalArgumentException: object is not an instance of declaring class
SR>
SR>How do I need to modify my mapping or classes so can i correctly operate on any
DataProducer class... do I need to downcast to the correct instance of someplace????
SR>
SR>Thanks in advance for any help!
Rich,
I've got some questions about your situation and then a troubleshooting
suggestion.
1) What is the key generator named UniqueID? Did you implement your
own key generator and plug it in to Castor?
2) Where is the client code? You posted the objects from the model,
but not the client code from whence the exception is thrown.
3) Does a simple OQL query for a DataProducer throw the exception
above? How about a simple read only query for a DataProducer?
I would really suggest scaling back your objects to *only* include
relations for the objects that are involved in the exceptions above
and nothing more. Get that working and then add the rest of the
relations and objects back in to the mix.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev