Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Spring Data Audit, JodaTime JDBC Driver/Hibernate exception -> Generics evolution ?

$
0
0
Hey all,


when my entity model is mapping one SpringData Auditable joda.DateTime property:

Code:

        @Column(name="LAST_MODIFIED_DATE")
        @Getter @Setter
        //private Date                lastModifiedDate;
        private DateTime        lastModifiedDate;

I got back a

Caused by: java.sql.SQLException: Unable to convert between net.sourceforge.jtds.jdbc.DateTime and BINARY.

(and FYI @Temporal is refused for the joda.DateTime)


but when I switch type with a usual/classical java.util.Date, I don't have anymore this problem...

so two questions:

- Has anyone ever experienced and solved this JodaTime + JTDS driver issue ?

- What about evolving the Interface: Auditable<U,ID extends Serializable> as a
Auditable<U,ID extends Serializable, DATE> allowing any implementation to choose its dedicated type for mapping dates ?

I'll try to put an adapter pattern between both types, providing conversion functionnalities... keep you informed...

Sincerely


i42

Viewing all articles
Browse latest Browse all 297

Trending Articles