Hi,
I'm using castor JDO and have a
question about the way SQL UPDATE instructions for objects are build by
castor...
For instance, I have the following
Envelope object declared in the jdo xml mapping file:
<class name=" Envelope"
access="shared" identity="envelopeID"
key-generator="MAX">
<map-to table="Envelope"
/>
<field name="envelopeID" type="long">
<sql
name="envelopeID" type="integer" />
</field>
<field name="name" type="string">
<sql
name="name" type="varchar" />
</field>
<field name="description" type="string">
<sql
name="description" type="clob" />
</field>
</class>
When activating JDO log writer, I
see that the generated update SQL for this envelope object
is:
UPDATE envelope set name=?,
description=? WHERE envelopeID=? AND name=? AND
description=?
I don't really understand why the
WHERE clause uses all declared field of the class ?
In this case, envelopeID is enough
to uniquely select the envelope row as envelopeID field is defined as the
identity field.
Furthermore, the WHERE clause also
filters on the declared clob/blob fields which is not supported with databases
like Oracle for instance.
Does anybody have any clue about
that ???
Thanks,
Benjamin.