I have an entity which extends an auditing entity class named AbstractAuditingEntity in which one of the field is
@CreatedDate
@Column(name = "created_date", nullable = false)
@JsonIgnore
private ZonedDateTime createdDate
Above field has mapping to database field named "created_date"
with type "timestamp without time zone"
.
But at the time of saving this entity PostgresSQL throws 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 looked for the same error & found solution here : Postgresql UUID supported by Hibernate?
But the solution is for java.util.UUID
, in solution it is suggested to add annotation @Type(type="pg-uuid")
on a field with UUID type.
Is there any such a ready-to-use type value like pg-uuid
for ZonedDateTime
? Any reference link for the different values constants of hibernate @Type
annotation ?
Or am supposed to write a custom deserializer class ? How to write such deserializer class any reference link ?
PostgresSQL Version : 9.6,
<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>