1

I have a JPA using Hibernate connected to SQLserver. It works but i have an exception each time i use entity with DateTimeOffset fields.

I tried with a custom type and used it like this:

@Basic(optional = false)
@Column(name = "EffectiveDate")
@org.hibernate.annotations.Type(type="DateTimeOffsetType")
private Serializable effectiveDate;

DateTimeOffsetType is my custom type I made like here: datetimeoffset hibernate mapping

But still, it don't works. How can I be able to read DateTimeOffset with hibernate and JPA?

Community
  • 1
  • 1
AxelF
  • 109
  • 3
  • 15
  • 1
    I tried with EclipseLink, and always the same error : DateTimeOffset cannot be converted to BINARY... – AxelF Sep 05 '12 at 14:19

1 Answers1

2

I finally resolved it by changing all the Serializable type of the fields in generated entities by TimeStamp types.

AxelF
  • 109
  • 3
  • 15