How to map serial and timestamptz of graphlql

那年仲夏 提交于 2020-12-15 04:03:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!