用hibernate+struts开发的,在操作两个数据库时,执行保存操作时报错,请高手指点下。 30
Hibernate:insertintoceshifulong.dbo.T_CC_StockBill(FClassTypeID,FBillNo,FDate,FBillTy...
Hibernate: insert into ceshifulong.dbo.T_CC_StockBill (FClassTypeID, FBillNo, FDate, FBillTypeID, FSupplyID, FPhone, FBiller, FCheckerID, FDBType, FDiffAmount, FDiffAcct, FEmpID, FDeptID, FBillerID, FCheckDate, FExplanation, FCustID, FFetchAdd, FFetchStyle, FFetchDate, FCheckerDate, FContact, FFax, FRollBackPrice, FUser, FStockInTypeID, FStockOutTypeID, FInvoiceType, FInvoiceNO, FCurPayAmount, FStatus, FPayTime, FPayOrderAmount, FAllAmount, FCheckAmount, FCurPayID, FAccountLimit, FAmount, FVoucherID, FUnCheckAmount, FClosed, FAddress, FAcctLimit, FAcctNo, FProcID, FCostVchID, FSettleLimitDate, FBalanceStyle, FCostAmount, FCurCheckAmount, FDiscountAcctId, FUserDefine1, FUserDefine2, FUserDefine3, FUserDefine4, FUserDefine5, FUserDefine6, FPrintCounts, FTotalProcurementCosts, FTitleTaxRate, FAllNetAmount, FSaveDate, FSettleAmount, FMultiAccount, FNeutralizeAmount) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2011-04-15 09:15:44,265 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 0, SQLState: null
2011-04-15 09:15:44,265 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] 必须执行该语句才能获得结果。
org.hibernate.exception.GenericJDBCException: could not insert: [com.run.dao.bean.TCcStockBill]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1777)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate 展开
2011-04-15 09:15:44,265 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 0, SQLState: null
2011-04-15 09:15:44,265 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] 必须执行该语句才能获得结果。
org.hibernate.exception.GenericJDBCException: could not insert: [com.run.dao.bean.TCcStockBill]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1777)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate 展开
展开全部
2011-04-15 09:15:44,265 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 0, SQLState: null
这里不是错误信息旦棚茄吗?应该是你的SQL有问模察题吧? 建议你把你写的SQL先拿到和配数据库先执行下
这里不是错误信息旦棚茄吗?应该是你的SQL有问模察题吧? 建议你把你写的SQL先拿到和配数据库先执行下
追问
用的是HQL的save()方法保存的。
追答
你把控制台上打印的SQL拿去数据库执行看看?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可能是主键问题,你生成主键的方式是手动添加橘漏还是让芦大数据库自动生成圆哗烂的?
能把orm配置文件贴出来看看吗?
能把orm配置文件贴出来看看吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
could not insert: [com.run.dao.bean.TCcStockBill]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException
说明你保存悉友的PO类型有问题,看睁颤槐洞衡看
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException
说明你保存悉友的PO类型有问题,看睁颤槐洞衡看
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据库应该有顷散主唯手键自增吧
hibernate映射类xml文件 id字段有个属性
<generator class="native" />这个有没有?雀山氏
hibernate映射类xml文件 id字段有个属性
<generator class="native" />这个有没有?雀山氏
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询