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 "Jenkins, David" <je...@fish.govt.nz> on 2003/03/26 03:18:37 UTC

2 problems with 0.9.7

Hi all,

1. Why does OJB unconditionally remove all M:n references when storing
an object, even though the auto-update flag is set to false? I have a
work around that sets and resets the IndirectionTable on the
CollectionDescriptor at run-time, but I'd rather not have to do this.
The deleteMtoNImplementor() method in
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl doesn't examine the
auto-update flag.

2. I'm storing a bean that has a 1:m Collection and it appears that the
conversion routines are not being called  when the Collection is being
persisted.
   I get a message from PersistentFieldPropertyImpl stating:

PersistentFieldPropertyImpl Error in operation [set] of object
[PersistentFieldPropertyImpl], java.lang.IllegalArgumentException
PersistentFieldPropertyImpl Declaring class
[nz.govt.fish.fishgis.data.MruUserLayerDO]
PersistentFieldPropertyImpl Property Name [userKey]
PersistentFieldPropertyImpl Property Type [java.lang.Integer]
PersistentFieldPropertyImpl anObject was class
[nz.govt.fish.fishgis.data.MruUserLayerDO]
PersistentFieldPropertyImpl aValue was class [java.math.BigDecimal]

Here's the Collection descriptor:
    <collection-descriptor
         name="mruLayers"
         element-class-ref="nz.govt.fish.fishgis.data.MruUserLayerDO"
         auto-retrieve="true"
         auto-update="true"
         auto-delete="true"
         orderby="mru_date"
         sort="DESC"
         refresh="true">
         <inverse-foreignkey field-id-ref="2"/>
    </collection-descriptor>

and here's one of the field descriptors that appears to fail :

<class-descriptor class = "nz.govt.fish.fishgis.data.MruUserLayerDO"...
    <field-descriptor id="2"
                      name="userKey"
                      column="user_key"
                      jdbc-type="NUMERIC"
                      nullable="false"
 
conversion="nz.govt.fish.fishgis.data.KeysConversion"
                      length="9"
                      precision="9"
                      scale="0"/>

As usual I shall discover what's wrong the second after I post this. But
just in case...

Dave