Reputation: 3053
I have a PostgreSQL database schema. And I am trying to generate JPA entities from that schema in IntelliJ with the integrated persistence tool. Everything works fine, except the mapping of timestamps.
The persistence tool is trying to map the PostgreSQL TIMESTAMP
data type to java.lang.Object
or java.io.Serializable
. I can't change the mapping to LocalDateTime
, String
or anything else.
Is there any way to set the correct mapping types?
UPDATE:
I get the following exception:
SchemaManagementException: Schema-validation: wrong column type encountered in column [timestamp] in table [ProcessEvent]; found [timestamptz (Types#TIMESTAMP)], but expecting [bytea (Types#VARBINARY)]
Upvotes: 0
Views: 459
Reputation: 1676
Have you used the proper annotation for the attribute?
@Entity
public class Employee {
...
@Basic
@Temporal(DATE)
private Calendar startDate;
...
}
Upvotes: 1