I have an object that extends an audit entity class called AbstractAuditingEntity, in which one of the fields
@CreatedDate @Column(name = "created_date", nullable = false) @JsonIgnore private ZonedDateTime createdDate
Above the field, it is mapped to a database field named "created_date" type "timestamp without time zone" .
But while saving this object, PostgresSQL throws an error as follows:
Caused by: org.postgresql.util.PSQLException: ERROR: column "created_date" is of type timestamp without time zone but expression is of type bytea Hint: You will need to rewrite or cast the expression.
I was looking for the same error and found a solution here: Postgresql UUID supported by Hibernate?
But the solution is for java.util.UUID , the solution proposes to add the @Type(type="pg-uuid") annotation @Type(type="pg-uuid") in the field with the UUID type.
Is there such a ready-to-use type value like pg-uuid for ZonedDateTime ? Any reference for different values โโof hibernate @Type annotation constants?
Or should I write my own deserializer class? How to write such a deserializer class link to link?
PostgresSQL Version : 9.6, <liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
source share