Spring Data JDBC: DataRetrievalFailureException : Unable to cast [oracle.sql.ROWID] to [java.lang.Number]

前端 未结 3 1504
悲哀的现实
悲哀的现实 2021-01-22 14:10

I am new to Spring Data JDBC, and I am struggling to create a simple Dto and get it persisted on the DB.

I am using Spring-Boot 2.1.1.RELEASE and and Oracle 12 Database.

3条回答
  •  囚心锁ツ
    2021-01-22 14:54

    I think you need to declare the USR_ID field and corresponding sequence in your entity

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "XXXX")
    @SequenceGenerator(sequenceName = "YYYY", allocationSize = 1, name = "XXXX")
    Long USR_ID;
    

提交回复
热议问题