各位网友,看到标题不要喷我啊。
开始需要这个问题,在网上搜索了一圈,都说参数中有NULL值。
我是用spring MVC插入一个对象,原来的表结构中有个字段是number类型,我hibernate配置文件配置的int
在插入工程中打印对象,对象只有一个值没有(这个值时默认的数据sysdate)。插入是,报这个错。后面我实在不知道什么原因,直接修改表结构。把number改成varchar2了,配置文件陪的string。
结果插入时,还报这个错。各位大侠们,求解释、意见啊。
开始需要这个问题,在网上搜索了一圈,都说参数中有NULL值。
我是用spring MVC插入一个对象,原来的表结构中有个字段是number类型,我hibernate配置文件配置的int
在插入工程中打印对象,对象只有一个值没有(这个值时默认的数据sysdate)。插入是,报这个错。后面我实在不知道什么原因,直接修改表结构。把number改成varchar2了,配置文件陪的string。
结果插入时,还报这个错。各位大侠们,求解释、意见啊。
解决方案 »
- java.lang.ArrayIndexOutOfBoundsException(数组越界)问题
- 如何在Struts2中取得web.xml中context-param的值(在线等)
- 当程序写好了时,怎么把程序做成软件,也就是exe文件,和配置服务器什么的。
- [在线求答案]$Proxy111 cannot be cast to de.laliluna.library.BookDao
- weblogic 几个产品之间的差别
- weblogic+informix下java equals判等问题?
- 用JAVAMAIL发送邮件,如何取得发送的状态码?急急急!
- 在js里,打开页面时,如何带参数?
- java 里 如何执行linux的ifconfig命令
- 关于Strut1.1+Tomcat5.0的问题!!!
- 关于java连接数据库关闭连接的问题
- SSH框架整合问题
//封装要保存的类
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;
}