How to Oracle XMLTYPE in Hibernate

前端 未结 2 1406
情歌与酒
情歌与酒 2021-01-14 16:29

One of the column is of the type XMLTYPE in Oracle database. In my application, I want to persist the data and using Hibernate.

I did the following for mapping XMLTY

相关标签:
2条回答
  • 2021-01-14 17:10

    I solved this same problem, but mapped the XMLType column to java.lang.String in my entity, which simplified the solution.

    I left a detailed, step-by-step solution as an answer to another question.

    0 讨论(0)
  • 2021-01-14 17:20

    I faced a lots of problem using XMLType from java, I fixed this problem is a very simple way.

    I changed the input data type from oracle DB side, from XMLtype to CLOB, then I easily pass CLOB and at the first line in the stored procedure; I built an XMLType from CLOB.

    CLOB is very straight forward in java, just use it as String (statement.setString(1, string);)

    0 讨论(0)
提交回复
热议问题