Skip to content

DateTime Column with @Version attribute #101

@mea-alexanm

Description

@mea-alexanm

Hello,
we have an application where we use optimisting locking like this:

@typedefs({ @typedef(name = "dateTime", defaultForType = org.joda.time.DateTime.class, typeClass = org.jadira.usertype.dateandtime.joda.PersistentDateTime.class) })
@column(name = "LAST_UPDATE")
@Version
private DateTime lastUpdate;

This worked perfectly fine until we recently upgraded our application to newer version - including jadira to 7.0.0.CR1.
Since then we get a class cast exception for above definition:
java.lang.ClassCastException: class org.jadira.usertype.dateandtime.joda.PersistentDateTime cannot be cast to class org.hibernate.usertype.UserVersionType

Having a look at the source code of jadira it seems there was a change in the class hierarchy for PersistentDateTime class from AbstractVersionableUserType to AbstractParameterizedTemporalUserType which causes this error. At least with our versions.

The versions used are:

  • jadira: 7.0.0.CR1
  • Hibernate: 5.4

Any ideas how to solve this? For now we are trying to go back to version 6.0.1.GA of Jadira.

Thx
Markus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions