Uploaded image for project: 'Hibernate ORM'
  1. HHH-8697

AttributeConverter not called when value is null

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3.0.Beta5
    • Fix Version/s: 4.3.9, 5.0.0.Beta1
    • Component/s: None
    • Labels:
    • Last commented by a user?:
      true

      Description

      Attribute converter not called when value is null.
      For example :
      If entity has boolean object and if the value is not set then it gets stored as null in data base irrespective of attribute converter mapping null value to "FALSE" . Other way round is also not happening. If value is null in database then value gets set to null.
      Root cause: BasicBinder.bind method does not call doBind if value is null.

        Attachments

        1. AttributeConvertedTestCase.zip
          7 kB
        2. BooleanTFConverter.java
          0.5 kB
        3. JpaAttributeConverterExample.java
          1 kB
        4. JpaAttributeConverterExampleTest.java
          2 kB
        5. persistence.xml
          1.0 kB
        6. pom.xml
          0.8 kB

          Issue links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 0.7h
                  0.7h