Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-80723

ServiceBuilder's convert-null property is ignored in CacheModel

Details

    Description

      In service.xml file String columns can be set to keep null value with specifying the convert-null="false" attribute.

      This works unless the CacheModel is used, as explicit conversion to empty string (aka "") always happens for it in case of null value.

      Steps to reproduce (DXP/7.0.x)

      1. Deploy the attached bundles: convert.null.test.api-1.0.0.jar, convert.null.test.service-1.0.0.jar, convert.null.test.mvc.portlet-1.0.0.jar
      2. Add ConvertNullTest-mvc portlet to a page and see what is logged:
        2018-04-20 13:35:31.223 INFO  [http-apr-8080-exec-10][ConvertNullTest:209] adding Foo...
        2018-04-20 13:35:31.234 INFO  [http-apr-8080-exec-10][ConvertNullTest:217] getting Foo...
        2018-04-20 13:35:31.234 INFO  [http-apr-8080-exec-10][ConvertNullTest:219] From DB: null
        2018-04-20 13:35:31.235 INFO  [http-apr-8080-exec-10][ConvertNullTest:226] getting Foo (this time from cache)...
        2018-04-20 13:35:31.235 INFO  [http-apr-8080-exec-10][ConvertNullTest:228] From Cache: "
        

      The test bundles don't deploy on master.
      As the issue is Service Builder related, there is no straightforward way to test the committed solution.

      Attachments

        Activity

          People

            raven.song Raven Song
            istvan.sajtos Istvan Sajtos
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 28 weeks ago

              Packages

                Version Package
                7.0.0 DXP FP47
                7.0.0 DXP SP8
                7.0.X
                7.1.0 Beta 2
                7.1.X
                7.2.X
                Master