hibernate ORA-00932: 数据类型不一致: 应为 NUMBER, 但却获得 BINARY

cuit_NB 2012-07-26 11:21:59
各位网友,看到标题不要喷我啊。
开始需要这个问题,在网上搜索了一圈,都说参数中有NULL值。
我是用spring MVC插入一个对象,原来的表结构中有个字段是number类型,我hibernate配置文件配置的int
在插入工程中打印对象,对象只有一个值没有(这个值时默认的数据sysdate)。插入是,报这个错。

后面我实在不知道什么原因,直接修改表结构。把number改成varchar2了,配置文件陪的string。
结果插入时,还报这个错。

各位大侠们,求解释、意见啊。
...全文
1121 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bonlog 2013-04-08
  • 打赏
  • 举报
回复
你的字符串处理错了, 你不能加载
cuit_NB 2012-07-27
  • 打赏
  • 举报
回复
悲剧啊,还是没有人回复,自己顶一下。
cuit_NB 2012-07-26
  • 打赏
  • 举报
回复
贴出来了,大哥。求看看。

[Quote=引用 2 楼 的回复:]

代码贴上来啊,这样怎么看明白,发上来对应的代码。
[/Quote]
cuit_NB 2012-07-26
  • 打赏
  • 举报
回复

//封装要保存的类
TcomplainRecord record = new TcomplainRecord();
record.setId(UUIDUtil.createID());
record.setReporterId(cn);
record.setReporterName(name);
record.setProcessState('0');
record.setIsAlert('0');
record.setModelFlag('0');
record.setReportTime(DateUtil.getTimestamp(new Date()));
record.setTitle(title);
record.setContent(content);
record.setDeptid(deptid);


complainService.saveComplain(record);
配置文件
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2012-7-25 14:13:48 by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
<class name="com.haier.portal.model.psicomplain.persistent.entity.TcomplainRecord" table="TCOMPLAIN_RECORD">
<id name="id" type="string">
<column name="ID" length="32" />
<generator class="uuid.hex" />
</id>
<property name="deptid" type="string">
<column name="DEPTID" length="5" />
</property>
<property name="reporterId" type="string">
<column name="REPORTER_ID" length="60" />
</property>
<property name="reporterName" type="string">
<column name="REPORTER_NAME" length="60" />
</property>
<property name="title" type="string">
<column name="TITLE" length="200" />
</property>
<property name="content" type="string">
<column name="CONTENT" length="2000" />
</property>
<property name="reportTime" type="serializable">
<column name="REPORT_TIME" />
</property>
<property name="processState" type="java.lang.Character">
<column name="PROCESS_STATE" length="1" />
</property>
<property name="modelFlag" type="java.lang.Character">
<column name="MODEL_FLAG" length="1" />
</property>
<property name="processTime" type="serializable">
<column name="PROCESS_TIME" />
</property>
<property name="isAlert" type="java.lang.Character">
<column name="IS_ALERT" length="1" />
</property>
<set name="tcomplainResults" table="TCOMPLAIN_RESULT" inverse="true" lazy="true" fetch="select">
<key>
<column name="CP_ID" length="32" />
</key>
<one-to-many class="com.haier.portal.model.psicomplain.persistent.entity.TcomplainResult" />
</set>
<set name="tcomplainAttachments" table="TCOMPLAIN_ATTACHMENT" inverse="true" lazy="true" fetch="select">
<key>
<column name="CP_ID" length="32" />
</key>
<one-to-many class="com.haier.portal.model.psicomplain.persistent.entity.TcomplainAttachment" />
</set>
</class>
</hibernate-mapping>

实体类

private String id;
private String deptid;
private String reporterId;
private String reporterName;
private String title;
private String content;
private Serializable reportTime;
private Character processState;
private Character modelFlag;
private Serializable processTime;
private Character isAlert;
private Set tcomplainResults = new HashSet(0);
private Set tcomplainAttachments = new HashSet(0);

public TcomplainRecord() {
}

public TcomplainRecord(String id) {
this.id = id;
}

public TcomplainRecord(String id,String deptid, TcomplainDepartment tcomplainDepartment,
String reporterId, String reporterName, String title,
String content, Serializable reportTime, Character processState,
Character modelFlag, Serializable processTime, Character isAlert,
Set tcomplainResults, Set tcomplainAttachments) {
this.id = id;
this.deptid = deptid;
this.reporterId = reporterId;
this.reporterName = reporterName;
this.title = title;
this.content = content;
this.reportTime = reportTime;
this.processState = processState;
this.modelFlag = modelFlag;
this.processTime = processTime;
this.isAlert = isAlert;
this.tcomplainResults = tcomplainResults;
this.tcomplainAttachments = tcomplainAttachments;
}

  • 打赏
  • 举报
回复
代码贴上来啊,这样怎么看明白,发上来对应的代码。
cuit_NB 2012-07-26
  • 打赏
  • 举报
回复
第二排的“需要”是“遇到”对不住了。

我来顶一下,大侠们,求给力啊,

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧