问题
I have the following data base which i am trying to make a mapping for it while the data base looks like the following
id ----> serial (nextval('id_seq'::regclass))
fromDate_ts ---> timestamptz
toDate_ts --> timestamptz
creating_ts--> timestamptz
so --> varchar
re--> int4
while writing mapping like this:
@Id
@Column(name = "id", nullable = false, insertable = false)
private Integer id;
@Column(name = "fromDate_ts ")
@Temporal(TemporalType.TIMESTAMP)
private Date fromDate;
@Column(name = "toDate_ts ")
@Temporal(TemporalType.TIMESTAMP)
private Date toDate
@Column(name = "creating_ts")
@Temporal(TemporalType.TIMESTAMP)
private Date creationTime;
@Column(name = "so")
private String so;
@Column(name = "re")
private Integer re;
And schema.graphqls
type Data{
id: Int
fromDate: String
toDate: String
creationTime:String
so:String
re:Int
}
I am getting this error
nested exception is org.hibernate.exception.DataException: could not execute query
SQL Error: 0, SQLState: 22003 bad value for type int
Caused by: org.postgresql.util.PSQLException: Bad value for type int : SUC_FIN
来源:https://stackoverflow.com/questions/65142030/how-to-map-serial-and-timestamptz-of-graphlql