解决:Weblogic容器、SSH框架下Hibernate映射Oracle XMLType方法与Jar包冲突
雪影工作室版权所有,转载请注明【http://blog.csdn.net/lina791211】
1、开发工具 MyEclipse 10 Pro
2、框架使用 Struts2.3,Hibernate3,Spring3.0.5 (标准SSH框架)
3、版本管理 svn 1.6 插件,visual svn 版本管理工具
4、数 据 库 Oracle 11g R2
引用Oracle官网对于Oracle的XMLType的部分解释
XMLType is a system-defined opaque type for handling XML data. It as predefined member functions on it to extract XML nodes and fragments.
You can create columns of XMLType and insert XML documents into it. You can also generate XML documents as XMLType instances dynamically using the SYS_XMLGEN and SYS_XMLAGG SQL functions.
Hibernate可以映射Oracle 的 XMLType,默认的是String类型,也可以改成Text类型。
如下所示,字段STORAGE_DETAIL_XML是一个Oracle的XMLType类型字段,Hibernate映射的时候自动映射成String
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!-- Mapping file autogenerated by MyEclipse Persistence Tools--><hibernate-mapping> <class name="com.CDSS.main.model.DatasourceStorage" table="DATASOURCE_STORAGE" schema="DBCDSS"> <id name="storageId" type="java.lang.Long"> <column name="STORAGE_ID" precision="22" scale="0" /> <generator class="native"> <param name="sequence">SEQUENCE_DSS</param> </generator> </id> <property name="dsId" type="java.lang.Long"> <column name="DS_ID" precision="22" scale="0" /> </property> <property name="storageDetailXml" type="com.CDSS.util.XMLHandle.OracleXMLType"> <column name="STORAGE_DETAIL_XML" /> </property> <property name="isReged" type="java.lang.String"> <column name="IS_REGED" /> </property> </class></hibernate-mapping>5.4、其它不变,然后部署,启动之前删除前面提到的冲突包。此时就可以直接使用Hibernate自带的Merge或者save或者update进行更新数据超过4000的信息了。
Hibernate还是需要继续努力的!