Skip to content

<jaxb:globalBindings> javaType causes @Transient #23

Closed
@mzdeb

Description

@mzdeb

Firstly thank you for your hard work! :)

I want to map Joda Time classes (LocalDate, LocalDateTime etc.) to DB so I configured globalBindings:

<jaxb:globalBindings>
    <jaxb:javaType name="org.joda.time.LocalDateTime"
        xmlType="xsd:dateTime" parseMethod="org.joda.time.LocalDateTime.parse"
        printMethod="java.lang.String.valueOf" />
    <jaxb:javaType name="org.joda.time.LocalDate" xmlType="xsd:date"
        parseMethod="org.joda.time.LocalDate.parse" printMethod="java.lang.String.valueOf" />
</jaxb:globalBindings>

I've also annotated fields with Hibernate Type annotation like:

        <jaxb:bindings node="//*[@type='xsd:dateTime']"
            multiple="true">
            <annox:annotate target="getter">@org.hibernate.annotations.Type(type
                = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
            </annox:annotate>
        </jaxb:bindings>

Result is:

    @Transient
    @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalDateTime")
    public LocalDateTime getDate() {
        return date;
    }

As you can see @transient is undesirable here. I've found similar bug for previous Hyperjaxb realeases: http://jira.highsource.org/browse/HJIII-97 but it's still unresolved.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions