Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      2

      Description

      > I have some optional (minOccurs=0) numeric fields that i'd like stored as
      > null when they don't exist. I see the generated POJOs have "has_<name>"
      > booleans which are set & used by unmarshall & marshall. Is there a way to
      > have hibernate use these? (It currently stores 0 for missing ones.)
      > (are those booleans a standard part of JAXB, or jaxbcommons extensions, or
      > HJ2?)

      They are generated if you generate "isSetXXX" methods, this is standard JAXB
      behaviour.

      Yes, there is a way to do that and I'm planning to do this. The trick is called
      "property accessors". For every property you cant define a class that will be
      used to access this property by it's name. I've implemented
      org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor that
      checks isSetXXX methods when returning the values (if isSetXXX returns false,
      getter will return null) and setting them (if value to be set is null, unsetXXX
      method will be called instead of the setter).
      I only have to update the mapping strategies and test it once again, so it will
      soon be available.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            hyperjaxb2-issues
            Reporter:
            lexi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: