3.3. From Earlier Versions to DbForms 1.1.4pr2

3.3.1. From all versions

(also see note for 1.1.4pr1 above) When upgrading from any previous release please note that: To have better control of the fields written to the database, we changed the interceptor interface of the preUpdate, preInsert, and preDelete events to:

   public int preXXXXXX(HttpServletRequest request,  
                        Table table, FieldValues fieldValues,
                        DbFormsConfig config, Connection con) 
          throws ValidationException
    

Now you have better control over the fields written to the database. You can remove, change, and add fields. Note however, that changes to fields marked with isKey="true" in the dbforms-config.xml file, are still disregarded by the preDelete and preUpdate methods.

In many cases, you only need to change the interfaces in your old interceptor code because the interface of the new FieldValues class is nearly the same as the previously used Hashtable.

However, to retrieve values from fieldValues you will need to change your interceptors in one of two ways. For example to retrieve a String

   String kanji = (String) fieldValues.get("kanji");

you now need to use one of the two following approaches.

  1. String kanji = (String)fieldValues.get("kanji").getFieldValueAsObject();
           

    This will parse the string and build an object of the required type. If the input field is of type String, it returns a String.

  2. String kanji = fieldValues.get("kanji").getFieldValue();
          

    This returns the String as it is written to the form. No further parsing is done as it returns a String.

Please also note that fields can now be removed using fieldValues.remove("yourNameOfTheField"); which was not previously possible.

3.3.2. From 1.1.4pr1

If you are upgrading from 1.1.4pr1, please adjust the following for the <filterCondition> tag (used embedded within the new <filter> tag). You must change your filter values for strings to not use the apostrophe. This is now done automatically.

So:

   name like '?' 

must be changed to

   name like ?