我在我的应用程序中使用 Hibernate + Oracle
我在下面的代码中收到错误
示例 1. 我的 pojo 类
public Test{
@Type(type = "blob2map")
public Map<String, String> param;
public Map<String, String> getParam() {
return param;
}
public void setParam(Map<String, String> param) {
this.param= param;
}
我的道类方法
public List<BusinessObject> searchByExample(Class<BusinessObject> entity, BusinessObject example) { return getSession().createCriteria(entity).add( Example.create(example)).list(); }
其中业务对象是 Test.class 和示例测试
由 hibernate 或 Oracle10gDialect 生成的查询是
从测试中选择 this_.id,this_.param where this_.param=?
完整的错误日志是
Exception in thread "main" java.sql.SQLException: ORA-00932: inconsistent datatypes: expected - got BLOB
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:420)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2929)
at com.csam.wsc.widget.management.BlobTester.showFilteredContent(BlobTester.java:55)
at com.csam.wsc.widget.management.BlobTester.main(BlobTester.java:98)