Skip to content

Set a jaxb:javaType to a part of composite keys make the IdClass attribute as String #27

Description

@trixprod

Hello,

This is a strange behaviors with Hyperjaxb ( tested with 0.5.6 and latest ).

If i specify a javaType (with parse and print method) to an attribute which is a part a composite key, then hyperjaxb create an IdClass (ok, composed with all keys attributes) but with the attribute typed as String ( and not Date as the following example ).

<jaxb:bindings node="xsd:element[@name='timestamp']" multiple="true" required="false" >
    <jaxb:javaType name="java.util.Date"
    parseMethod="com.test.RFC2282DateAdapter.parseDate"
    printMethod="com.test.RFC2282DateAdapter.printDate"/>                  
</jaxb:bindings>

Results :

     @XmlAccessorType(XmlAccessType.FIELD)
    public static class TickerId {

        @XmlSchemaType(name = "dateTime")
        protected String timestamp; // Should be a Date there !!
        protected String currency; // Other part of the composite key, that's ok
        ...
   }

If i remove the binding an XMLGregorianCalendar is generated (i don't want this), moreover a parse exception is throwed. That's normal because the string date format found is not recognized as the standard date format.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions