How to Oracle XMLTYPE in Hibernate

前端 未结 2 1428
情歌与酒
情歌与酒 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: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);)

提交回复
热议问题