4 Replies Latest reply: Apr 10, 2012 10:27 AM by newToplinkUser RSS

    DirectToFieldMapping setNullValue does not work as expected

    newToplinkUser
      I have the following mapping:

      DirectToFieldMapping dailyPLMapping = new DirectToFieldMapping();
      dailyPLMapping.setAttributeName("dailyPL");
      dailyPLMapping.setFieldName("IDCRULESET.DAILYPL");
      dailyPLMapping.setNullValue(new java.lang.Boolean("false"));
      ObjectTypeConverter dailyPLMappingConverter = new ObjectTypeConverter();
      dailyPLMappingConverter.setDefaultAttributeValue(new java.lang.Boolean("false"));
      dailyPLMappingConverter.addConversionValue(new Character('F'), new java.lang.Boolean("false"));
      dailyPLMappingConverter.addConversionValue(new Character('T'), new java.lang.Boolean("true"));
      dailyPLMapping.setConverter(dailyPLMappingConverter);
      descriptor.addMapping(dailyPLMapping);

      when dailyPL is null, I am seeing null being inserted into DAILYPL db column, also
      when viewed in debugger, dailyPLMapping.nullValue field appears null, even though the value
      is set in descriptors, this used to work fine in toplink.

      Current version Eclipselink 2.3.3

      Thanks