We ran into a situation where we had a previously created seeded entity who
had a field value that we wanted to change to null.  The current data load
process would take values from the data files and if the field value was set
to either empty string OR was not present, would ignore this field
attribute.  The net result, was that there was no way to get "null"
populated on the entity via the standard data load update mechansim.

As a result, I created this ticket OFBIZ-3421 with a small fix that would
treat something like :

    <ProductSubscriptionResource 
        productId="DNSZONE" subscriptionResourceId="DNSZONE"
fromDate="2009-01-01 00:00:00.0" 
        useTime="1" useTimeUomId="TF_mon" 
        useCountLimit="null"
        canclAutmExtTime="1" canclAutmExtTimeUomId="TF_day"
        useRoleTypeId="CUSTOMER" 
        automaticExtend="Y"/>

As updating the useCountLimit to null on update.  Upon further discussion,
the thought was that perhaps we should change how Ofbiz treats elements that
are explicitly set to "" so that they are treated as null in general (rather
than being ignored like they are not specified at all).

What I am saying here is the current data load would treat useCountLimit=""
exactly the same as if useCountLimit was not specified at all.  And we are
suggesting that useCountLimit="" should really be treated as updating to
null so that a previous value would be reset to null.

That would prevent the "hack-like" feeling I am getting from treating "null"
as some sort of keyword which is what I had done in this resolution.

The net result of this, is that we would likely have to blow through about
1400 instances of *Data.xml files that are explicitly setting fields to =""
since it is likely that they really want them ignored.
-- 
View this message in context: 
http://n4.nabble.com/Supporting-null-in-data-load-update-tp1100195p1100195.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to