hibernate 原生sql插入 报错 [问题点数:200分,结帖人mmqw1122]

Bbs3
本版专家分:701
Blank
GitHub 绑定GitHub第三方账户获取
结帖率 100%
Bbs3
本版专家分:701
Blank
GitHub 绑定GitHub第三方账户获取
Bbs7
本版专家分:10288
Blank
红花 2017年12月 Java大版内专家分月排行榜第一
Blank
蓝花 2017年10月 Java大版内专家分月排行榜第三
Bbs3
本版专家分:701
Blank
GitHub 绑定GitHub第三方账户获取
Bbs3
本版专家分:701
Blank
GitHub 绑定GitHub第三方账户获取
Bbs3
本版专家分:805
Bbs3
本版专家分:701
Blank
GitHub 绑定GitHub第三方账户获取
Bbs4
本版专家分:1668
hibernate原生sql注意点
需要什么就查什么 这是写<em>hibernate</em><em>原生</em><em>sql</em>的原因 写<em>原生</em><em>sql</em>(my<em>sql</em>中)需要注意的问题 1.时间字段 update_timedatetime DEFAULT NULL 实体类中: private String serviceTime; 获取的时候,先转Date,再转String customerAlarm.setTime(DateUtil.getStringDat...
有关hibernate原生sql查询
我的表为:testtablern字段为:id int not,name decimal(10,2);rn<em>插入</em>的测试数据为:rn1,10.2rnSQLQuery query = con.createSQLQuery("select * from testtable");rnList products = query.list();rn<em>报错</em>如下:rn2010-5-20 15:18:17 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.lang.ArithmeticException: Rounding necessaryrn at java.math.BigDecimal.divide(BigDecimal.java:1346)rn at java.math.BigDecimal.setScale(BigDecimal.java:2310)rn at org.<em>hibernate</em>.type.BigIntegerType.get(BigIntegerType.java:35)rn at org.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:163)rn at org.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:189)rn at org.<em>hibernate</em>.loader.custom.CustomLoader$ScalarResultColumnProcessor.extract(CustomLoader.java:474)rn at org.<em>hibernate</em>.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:420)rn at org.<em>hibernate</em>.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:317)rn at org.<em>hibernate</em>.loader.Loader.getRowFromResultSet(Loader.java:606)rn at org.<em>hibernate</em>.loader.Loader.doQuery(Loader.java:701)rn at org.<em>hibernate</em>.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)rn at org.<em>hibernate</em>.loader.Loader.doList(Loader.java:2213)rn at org.<em>hibernate</em>.loader.Loader.listIgnoreQueryCache(Loader.java:2104)rn at org.<em>hibernate</em>.loader.Loader.list(Loader.java:2099)rn at org.<em>hibernate</em>.loader.custom.CustomLoader.list(CustomLoader.java:289)rn at org.<em>hibernate</em>.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)rn at org.<em>hibernate</em>.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)rn at org.<em>hibernate</em>.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)rn at org.chinaecce.b2b.service.impl.b2bQ.ProductListService.editQueryProduct(ProductListService.java:320)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Hibernate 原生sql 关联查询问题!
sess.createSQLQuery("select p.*,u.* from pthread pft left join users u on p.user_id=u.user_id ") rn .addEntity("p", Pthread .class) rn .addEntity("u", Users.class) rn这样得到 query后怎么通过query得到相关联的实体类啊!rn求大神指点!rnrn就只用<em>sql</em>查询 不用hql!
hibernate执行原生sql语句
<em>hibernate</em>执行<em>原生</em><em>sql</em>语句
Hibernate使用原生SQL查询
如题,想使用Hibernate的<em>原生</em>SQL查询功能.代码如下:rnrn<em>hibernate</em>配置文件rn[code=XML]rnrn rn rn rn selectrn rl.FUNCTIONID as menu.functionId,rn fl.FUNCTIONNAME as menu.functionName,rn fl.FUNCTIONURL as menu.functionUrl,rn fl.FUNCTIONTYPID as menu.functionTypIdrn from rn DBO.ROLELIST rl,rn DBO.FUNCTIONLIST flrn where rn rl.ROLEID = :roleidrn and rl.FUNCTIONID = fl.FUNCTIONIDrn order by rl.FUNCTIONID ascrn rn rnrn[/code]rnrn我使用的服务器是Tomcat6.0.每次在发布的时候,会报出以下错误:rn[code=Java]rn2011-4-20 5:19:43 org.springframework.web.context.ContextLoader initWebApplicationContextrn严重: Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.<em>hibernate</em>.HibernateException: Errors in named queries: getMenuListrn[/code]rnrn查了很久,不晓得到底是错在什么地方.还望各位能不吝赐教...谢谢了先...
Hibernate 原生SQL不能分页
用<em>原生</em>SQL查询视图,ViewOfExceptionNetUnit 没用<em>hibernate</em>影射,用了分页就查询不出来,List为空,不用就可以查出来。rn代码如下:rn public List findExceptionSearch(final int startIndex, final int pageSize,rn final String netUnitAreaManagerFullIdSeq, final String netUnitName,rn final String netUnitCode, final String areas, final String exceptiontype,rn final String BeginDate, final String EndDate, final String order) rn rn // 调用模板的execute方法,参数是实现了HibernateCallback接口的匿名类,rn return (List) this.getHibernateTemplate().execute(rn new HibernateCallback() rn // 重写其doInHibernate方法返回一个object对象,rn public Object doInHibernate(Session session)rn throws HibernateException, SQLException rn //String <em>sql</em> = "SELECT nunit.AreaManagerName,nunit.NetUnitName,nunit.NetUnitCode,nunit.ExceptionState,max(ExceptionDate) as LasterExceptionTime,nunit.NetUnitBusinessState,count(ExceptionState) as ExceptionTimes FROM ViewOfExceptionNetUnit as nunit WHERE 1 = 1 and nunit.NetUnitCode NOT IN (select F_AreaCode from IgnoreGlobal) AND nunit.ExceptionState = '7' AND nunit.ExceptionDate >='"+BeginDate+"' AND nunit.ExceptionDate = '"+BeginDate+"' ";rn rn if( EndDate!= null && !EndDate.equals("")) rn <em>sql</em> += "and nunit.ExceptionDate +query.list().size());rn return list;rnrn rnrn );rn
[请问]Hibernate原生SQL的问题
我的类和映射文件都没有问题,用HQL可以查出数据rn可是我用<em>原生</em>的SQL就总是<em>报错</em>,具体如下:rnQuery query = session.createSQLQuery(rn"select customer.CustomerId AS customer.name from E_Customer customer","customer",Customer.class);rnquery.setMaxResults(10);rnquery.list();rnrn<em>报错</em>如下:rnHibernate: select top 10 customer.CustomerId AS CustomerID0_ from E_Customer customerrnWARN JDBCExceptionReporter.logExceptions(57) : SQL Error: 0, SQLState: 07009rnERROR JDBCExceptionReporter.logExceptions(58) : Invalid column name Customer1_0_.rnWARN JDBCExceptionReporter.logExceptions(57) : SQL Error: 0, SQLState: 07009rnERROR JDBCExceptionReporter.logExceptions(58) : Invalid column name Customer1_0_.rnnet.sf.<em>hibernate</em>.exception.SQLGrammarException: error performing findBySQLrn at net.sf.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:58)rn at net.sf.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.convert(SessionImpl.java:4131)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.findBySQL(SessionImpl.java:3870)rn at net.sf.<em>hibernate</em>.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)rn at com.yimi.<em>hibernate</em>.test.HiberanteTest.test1(HiberanteTest.java:53)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:324)rn at junit.framework.TestCase.runTest(TestCase.java:154)rn at junit.framework.TestCase.runBare(TestCase.java:127)rn at junit.framework.TestResult$1.protect(TestResult.java:106)rn at junit.framework.TestResult.runProtected(TestResult.java:124)rn at junit.framework.TestResult.run(TestResult.java:109)rn at junit.framework.TestCase.run(TestCase.java:118)rn at junit.framework.TestSuite.runTest(TestSuite.java:208)rn at junit.framework.TestSuite.run(TestSuite.java:203)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)rnCaused by: java.<em>sql</em>.SQLException: Invalid column name Customer1_0_.rn at net.sourceforge.jtds.jdbc.JtdsResultSet.findColumn(JtdsResultSet.java:885)rn at net.sourceforge.jtds.jdbc.JtdsResultSet.getInt(JtdsResultSet.java:889)rn at net.sf.<em>hibernate</em>.type.IntegerType.get(IntegerType.java:21)rn at net.sf.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:62)rn at net.sf.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:53)rn at net.sf.<em>hibernate</em>.loader.Loader.getKeyFromResultSet(Loader.java:431)rn at net.sf.<em>hibernate</em>.loader.Loader.getRowFromResultSet(Loader.java:205)rn at net.sf.<em>hibernate</em>.loader.Loader.doQuery(Loader.java:285)rn at net.sf.<em>hibernate</em>.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)rn at net.sf.<em>hibernate</em>.loader.Loader.doList(Loader.java:1063)rn at net.sf.<em>hibernate</em>.loader.Loader.list(Loader.java:1054)rn at net.sf.<em>hibernate</em>.loader.SQLLoader.list(SQLLoader.java:92)rn at net.sf.<em>hibernate</em>.impl.SessionImpl.findBySQL(SessionImpl.java:3867)rn ... 17 morernrnrn请问是不是还要在<em>hibernate</em>.cfg.xml中配置一些属性什么的?还是我写的程序有问题,望解答
Hibernate原生sql与HQL的区别
1.hql是面向对象 例如 select  deptNo from Dept    Dept 是类名  deptNo是属性名 2.但<em>sql</em>中 例如 上了select deptno from dept dept是表名 deptno是列名 <em>sql</em>是查询出来的就是Hql的投影因为<em>sql</em>不会自动生成对象 所以我们要用object[] 去接受
hibernate中的原生sql查询
<em>原生</em>SQL查询:面向数据库的查询,查询语句的关键词是数据库的表名,列名 最<em>原生</em>,适应各种情形,尤其复杂业务 public void fun1(){ Session session = HibernateUtils.openSession(); Transaction tx = session.beginTransaction(); String <em>sql</em> = "select * from
HIBERNATE如何使用原生SQL
需要详细点的步骤啊。谢谢各位 大神啊rn是不是也应该继承HibernateDaoSupport这个类啊?rn求教。
hibernate 原生sql与存储过程 求助
我用<em>hibernate</em>调用<em>原生</em><em>sql</em>语句和存储过程的方式基本相同rnSession session=HibernateSessionFactory.getSession();rnSQLQuery sq=session.createSQLQuery(<em>sql</em>);rnrn这里这个sq对象会根据<em>sql</em>语句来调用查询,比如<em>sql</em>="select * from table"表示查询某个表,<em>sql</em>="select * from proc('a','b')"表示调用某个存储过程。rnrn现在有个问题,还请高手指点下。如果都用这种方式,那么<em>hibernate</em>是怎么区分什么时候是查询,什么时候是调用存储过程的?之所以有这个问题是因为jdbc执行<em>sql</em>语句查询和调用存储过程用的是不同的方式。求指导,求解释
hibernate 原生sql 聚合函数问题
code=Java]rnrnpublic List findLampsBoxID(int boxID, int boxgruop) rn rn List list = null;rn Session session = this.getSession();rn try rn String <em>sql</em> = "FROM LampInfo "rn + " WHERE LampID IN(SELECT max(LampID) FROM LampInfo"rn + " WHERE IsDoubleLamp='Y' and boxID= " + boxID + " and boxgruop= " + boxgruop + " "rn + " GROUP BY SUBSTR(LAMPNO,1,LENGTH(LampNo)-1))"rn + " UNION ALL FROM LampInfo WHERE NVL(IsDoubleLamp,'')<>'Y' and "rn + " and boxID= " + boxID + " and boxgruop= " + boxgruop + " order by groupnum ";rn rn Query query = session.createQuery(<em>sql</em>);rn list = query.list();rn return list;rn catch (Exception e) rn e.printStackTrace();rn return null;rn finally rn session.close();rn rnrn rn[/code]rnrnLampID boxID boxgruop groupnum 都为LampInfo的字段rnrn程序<em>报错</em>No data type for node .. AggregateNode: 'max' (SSH框架,SQL语句单独测试过没错,关键在SSH框架下MAX MIN等聚合函数会<em>报错</em>
hibernate使用原生sql帮助类
      Hibernate出现很久了,的确用起来很省事,只需要处理对象就可以操作数据库。但是凡事都有两面性,它的省事带来的一个问题就是确实不太灵活。有时候一句SQL搞定的事情,用HQL写看后台日志的话会发现它会把简单的事情复杂化,大大降低了效率。         Hibernate支持SQL情况如下:session.createSQLQuery(&quot;select * from xxx w...
hibernate插入报错。。。求解答!
2012-3-23 10:06:11 org.<em>hibernate</em>.util.JDBCExceptionReporter logExceptions rn 警告: SQL Error: 1452, SQLState: 23000 rn 2012-3-23 10:06:11 org.<em>hibernate</em>.util.JDBCExceptionReporter logExceptions rn 严重: Cannot add or update a child row: a foreign key constraint fails (`studysystem`.`articleinfor`, CONSTRAINT `FKE90A0E4EE57DF3E5` FOREIGN KEY (`typeid`) REFERENCES `articletype` (`typeid`)) rn org.springframework.dao.DataIntegrityViolationException: could not insert: [com.studysystem.model.article.ArticleInfor]; SQL [insert into articleinfor (articleName, authorName, brandid, clickcount, commend, content, createDate, description, typeid, viewcount, visible) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.<em>hibernate</em>.exception.ConstraintViolationException: could not insert: [com.studysystem.model.article.ArticleInfor] rn at org.springframework.orm.<em>hibernate</em>3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637) rn at org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:411) rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:683) rn at com.studysystem.dao.handler.imp.spring.SpringHandler.saveObj(SpringHandler.java:58) rn at com.studysystem.dao.BaseDAO.save(BaseDAO.java:41) rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) rn at java.lang.reflect.Method.invoke(Method.java:597) rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) rn at $Proxy29.save(Unknown Source) rn at com.studysystem.service.BaseService.save(BaseService.java:32) rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) rn at java.lang.reflect.Method.invoke(Method.java:597) rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) rn at $Proxy39.save(Unknown Source) rn at JUnit.test.ArticleInforServiceTest.testSave(ArticleInforServiceTest.java:68) rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) rn at java.lang.reflect.Method.invoke(Method.java:597) rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) rn at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) rn at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) rn at org.junit.runners.ParentRunner.run(ParentRunner.java:300) rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) rn Caused by: org.<em>hibernate</em>.exception.ConstraintViolationException: could not insert: [com.studysystem.model.article.ArticleInfor] rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:96) rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) rn at org.<em>hibernate</em>.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329) rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2836) rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) rnrn这是我junit测试出来的rnJava代码 收藏代码rnrn org.<em>hibernate</em>.AssertionFailure: null id in com.studysystem.model.article.ArticleInfor entry (don't flush the Session after an exception occurs) rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:82) rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:190) rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:147) rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219) rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) rn at org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:1206) rn at org.<em>hibernate</em>.impl.SessionImpl.managedFlush(SessionImpl.java:375) rn at org.<em>hibernate</em>.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) rn at org.springframework.orm.<em>hibernate</em>3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656) rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) rn at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:375) rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) rn at $Proxy39.save(Unknown Source) rn at JUnit.test.ArticleInforServiceTest.testSave(ArticleInforServiceTest.java:68) rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) rn rn
hibernate插入数据库语句报错??
log4j:WARN No appenders could be found for logger (org.<em>hibernate</em>.cfg.Environment).rnlog4j:WARN Please initialize the log4j system properly.rnorg.<em>hibernate</em>.exception.SQLGrammarException: could not insert: [com.<em>hibernate</em>.admin.Tadmin]rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:59)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1777)rn at org.<em>hibernate</em>.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:239)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:481)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:476)rn at com.<em>hibernate</em>.admin.TadminTest.testInsert(TadminTest.java:60)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:324)rn at junit.framework.TestCase.runTest(TestCase.java:154)rn at junit.framework.TestCase.runBare(TestCase.java:127)rn at junit.framework.TestResult$1.protect(TestResult.java:106)rn at junit.framework.TestResult.runProtected(TestResult.java:124)rn at junit.framework.TestResult.run(TestResult.java:109)rn at junit.framework.TestCase.run(TestCase.java:118)rn at junit.framework.TestSuite.runTest(TestSuite.java:208)rn at junit.framework.TestSuite.run(TestSuite.java:203)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: java.<em>sql</em>.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'dbo.Tadmin' 无效。rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processErrorToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRPCRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReply(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.SQLServerImplStatement.getNextResultType(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)rn at org.<em>hibernate</em>.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1744)rn ... 29 morernHibernate: insert into dbo.Tadmin (AdminName, AdminPassword) values (?, ?) select scope_identity()rnrn配置文件rnrnrnrnrn rn rn rn rn rn rn rnrnrnrnrnrnrnrnrnrn dbconnrn jdbc:microsoft:<em>sql</em>server://localhost:1433rn sarn rn com.microsoft.jdbc.<em>sql</em>server.SQLServerDriverrn org.<em>hibernate</em>.dialect.SQLServerDialectrn Truern rn rnrnrn
tp5执行原生sql报错
$timestamp = time(); $start_time = date(‘Y-m-d 00:00:00’, strtotime(“this week Monday”, $timestamp)); $end_time = date(‘Y-m-d 23:59:59’, strtotime(“this week Sunday”, $timestamp)); KaTeX parse erro...
使用Hibernate的 原生SQL 查询报错,求大神
上代码:Example是我的实体类rnrn String <em>sql</em>="select 1 ,2 from example";rn SQLQuery q=sessionFactory.getCurrentSession().createSQLQuery(<em>sql</em>).addEntity("", Example.class); rn return q.list();rn rn 如果我把<em>sql</em>改成:“ select 1,2 from dual ”; 就不会<em>报错</em>。rn 如果我 改成HQL 查询 也不会<em>报错</em>: Query q=sessionFactory.getCurrentSession().createQuery("from Example");也不会<em>报错</em>,rn 我就日了 狗了!rn rn<em>报错</em>信息:rn rn Struts Problem ReportrnrnStruts has detected an unhandled exception:rnrnMessages: rnTable 'my<em>sql</em>.example' doesn't existrncould not execute queryrnFile: org/<em>hibernate</em>/exception/SQLStateConverter.javarnLine number: 92rnStacktracesrnrnorg.<em>hibernate</em>.exception.SQLGrammarException: could not execute queryrn org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:92)rn org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)rn org.<em>hibernate</em>.loader.Loader.doList(Loader.java:2452)rn org.<em>hibernate</em>.loader.Loader.listIgnoreQueryCache(Loader.java:2192)rn org.<em>hibernate</em>.loader.Loader.list(Loader.java:2187)rn org.<em>hibernate</em>.loader.custom.CustomLoader.list(CustomLoader.java:316)rn org.<em>hibernate</em>.impl.SessionImpl.listCustomQuery(SessionImpl.java:1832)rn org.<em>hibernate</em>.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)rn org.<em>hibernate</em>.impl.SQLQueryImpl.list(SQLQueryImpl.java:179)rn cn.hjw.oa.dao.impl.ExamplDaoImpl.selAll(ExamplDaoImpl.java:63)rn cn.hjw.oa.dao.impl.ExamplDaoImpl$$FastClassByCGLIB$$f9a596c5.invoke()rn net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)rn org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)rn cn.hjw.oa.dao.impl.ExamplDaoImpl$$EnhancerByCGLIB$$a921a677.selAll()rn cn.hjw.oa.service.impl.ExampleServiceImpl.selAllService(ExampleServiceImpl.java:34)rn cn.hjw.oa.action.ExampleAction.selAllAc(ExampleAction.java:39)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
在Hibernate中使用原生SQL语句时报错
在Hibernate中使用了以下SQL语句就会<em>报错</em>rnrnselect sum(actual_amount) from consumernrn字段actual_amount在数据库是decimal类型,在JAVA影射文件是java.math.BigDecimal类型rn异常信息:rnorg.<em>hibernate</em>.MappingException: No Dialect mapping for JDBC type: 3rn at org.<em>hibernate</em>.dialect.TypeNames.get(TypeNames.java:56)rn at org.<em>hibernate</em>.dialect.TypeNames.get(TypeNames.java:81)rn at org.<em>hibernate</em>.dialect.Dialect.getHibernateTypeName(Dialect.java:192)rn at org.<em>hibernate</em>.loader.custom.CustomLoader.getHibernateType(CustomLoader.java:170)rn at org.<em>hibernate</em>.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:138)rn at org.<em>hibernate</em>.loader.Loader.getResultSet(Loader.java:1678)rn at org.<em>hibernate</em>.loader.Loader.doQuery(Loader.java:662)rn at org.<em>hibernate</em>.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)rn at org.<em>hibernate</em>.loader.Loader.doList(Loader.java:2150)rn at org.<em>hibernate</em>.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn at org.<em>hibernate</em>.loader.Loader.list(Loader.java:2024)rn at org.<em>hibernate</em>.loader.custom.CustomLoader.list(CustomLoader.java:117)rn at org.<em>hibernate</em>.impl.SessionImpl.listCustomQuery(SessionImpl.java:1607)rn at org.<em>hibernate</em>.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:121)rn at org.<em>hibernate</em>.impl.SQLQueryImpl.list(SQLQueryImpl.java:169)rn at com.creawor.vipus.struts.action.business.IndexAction.executeAction(IndexAction.java:104)rn at com.creawor.vipus.struts.action.BaseAction.execute(BaseAction.java:141)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)rn at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)rn at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:89)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)rn at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)rn at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)rn at java.lang.Thread.run(Thread.java:595)rnrn
Hibernate 连接SQL报错
[code=html]rnrnrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn org.<em>hibernate</em>.dialect.SQLServerDialectrn truern updaternrn rn rn rn rn rn rn rn rn rn rn rnrn [/code]rnrn[code=html]rn rn rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rn23:28:53,137 WARN SqlExceptionHelper:143 - SQL Error: 18456, SQLState: S0001rn23:28:53,137 ERROR SqlExceptionHelper:144 - 用户 'aoe' 登录失败。 ClientConnectionId:49f26c3c-626f-474f-813b-25f44ae8522drnorg.<em>hibernate</em>.exception.SQLGrammarException: Could not open connectionrn at org.<em>hibernate</em>.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122)rn at org.<em>hibernate</em>.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)rn at org.<em>hibernate</em>.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)rn at org.<em>hibernate</em>.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)rn at org.<em>hibernate</em>.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)rn at org.<em>hibernate</em>.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)rn at org.<em>hibernate</em>.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)rn at org.<em>hibernate</em>.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)rn at org.<em>hibernate</em>.internal.SessionImpl.beginTransaction(SessionImpl.java:1396)rn at com.hdu.daoImpl.UserDaoImpl.register(UserDaoImpl.java:50)rn at com.hdu.daoImpl.UserDaoImplTest.testRegister(UserDaoImplTest.java:30)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)rn at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: com.microsoft.<em>sql</em>server.jdbc.SQLServerException: 用户 'aoe' 登录失败。 ClientConnectionId:49f26c3c-626f-474f-813b-25f44ae8522drn at com.microsoft.<em>sql</em>server.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)rn at com.microsoft.<em>sql</em>server.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254)rn at com.microsoft.<em>sql</em>server.jdbc.TDSParser.parse(tdsparser.java:84)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2908)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)rn at com.microsoft.<em>sql</em>server.jdbc.TDSCommand.execute(IOBuffer.java:5696)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)rn at com.microsoft.<em>sql</em>server.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)rn at java.<em>sql</em>.DriverManager.getConnection(DriverManager.java:571)rn at java.<em>sql</em>.DriverManager.getConnection(DriverManager.java:187)rn at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)rn at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)rn at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)rn at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)rn at org.<em>hibernate</em>.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)rn at org.<em>hibernate</em>.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:281)rn at org.<em>hibernate</em>.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297)rn ... 29 morrn我使用rnConnection conn = null;rn try rn Class.forName("com.microsoft.<em>sql</em>server.jdbc.SQLServerDriver");rn try rn conn = DriverManager.getConnection("jdbc:<em>sql</em>server://139.129.41.74:1433;databaseName=aoe","aoe","82090016");rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn catch (ClassNotFoundException e) rn e.printStackTrace();rn rn return conn;rn [/code]rn正确的
hibernate sql语句报错
[code=java]final String hql = "update pain m set m.sprq = to_date(':sprq','yyyy-mm-dd hh24:mi:ss'),m.spr = :spr";rn return <em>hibernate</em>Dao.createQuery(hql).setString("sprq", sprq)rn .setString("spr", spr).executeUpdate();[/code]rnrnrn求大神们帮忙看看我这个<em>sql</em>怎么一执行就报下面的错误rnParameter sprq does not exist as a named parameter in [update pain m set m.sprq = to_date(':sprq','yyyy-mm-dd hh24:mi:ss'),m.spr = :spr]
impala SQL插入报错
impala<em>插入</em>数据的时候,出现<em>报错</em>: [hs-170:21000] &amp;amp;gt; insert into test_abc(fund_account, client_name, client_sex) values('1234567890123456789001', 'name1', '0'); Query: insert into test_abc(fund_account, client_nam...
hibernate插入信息出错,控制台报错sql有问题
WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
hibernate使用原生sql查询Hibernate原生SQL多表查询字段名重复问题以及解决方法
注:实际业务中可能比较复杂不得不用<em>原生</em><em>sql</em>执行时可能会遇到该问题,为了描述问题,本例采用简单的举例 表1: tbtask: 具有如下列:taskId,name,groupId 表2: tbtaskGroup: 具有如下列:tbgroupId,name 使用<em>原生</em><em>sql</em>表连接获取task表和group表的name信息 select task.name,group.name from
hibernate原生sql查询最新的不支持了吗?
The method createSQLQuery(String) from the type QueryProducer is deprecatedrnrn网上大部分的教程都是用的这个方法,然而现在<em>hibernate</em>提示尽量用别的方法来操作。我新新新手,请问<em>hibernate</em>最新的几个版本是不是不再支持<em>sql</em>了,只能用hql???rnrncreateSQLQuery这个过时的话,我还能用什么方式去执行<em>原生</em><em>sql</em>??
几种hibernate原生sql查询返回值
1.---SELECT  new map(main.id AS id3333,main.startdate AS startdate) from WeekData main 上述返回值是List>---map的key为as后面的别名,value为实际查询结果 2.---SELECT  new map(main.id,main.startdate) from WeekData main 上述返
持久化框架Hibernate和Mybatis之原生SQL
今天项目中遇到一个问题,使用持久化框架Hibernate时,需要为一张数据表中的非主键字段设置自增,每次保存的时候就不用再为该字段设置值,可通过语句 select XXX_SEQ_NAME.nextval from dual 从oracle数据中查询获得该字段的自增值。由于dual是oracle数据库中的虚拟表,所以无法使用hql,这时就需要考虑在<em>hibernate</em>框架下执行<em>原生</em><em>sql</em>了。
hibernate 执行原生sql的几种方式
NULL 博文链接:https://ynp.iteye.com/blog/2007053
hibernate原生sql查询返回多个实体
List list=createSQLQuery(<em>sql</em>).addEntity(&quot;student&quot;,Student.class).addEntity(&quot;user&quot;,User.class).list(); 返回的list是一个object数组 object[0]=Student object[1]=User 以此类推.
Hibernate 原生SQL查询反射到POJO
在使用<em>hibernate</em>过程中有许多查询需要用到<em>sql</em><em>原生</em>语句进行查询。同时又希望查询结果可以直接保存到POJO对象中。下面给出<em>hibernate</em>的实现方式。 需求: 查询如下表: [img]http://dl.iteye.com/upload/attachment/0080/5743/3d05c753-841d-3685-8e3c-e88c39762fa1.jpg[/img] ...
hibernate原生sql的模糊查询占位符设置问题。
在<em>hibernate</em>中使用<em>原生</em><em>sql</em>模糊查询设置占位符时不能把%放在SQL语句中,而是要放在setParameter()中, 例如 String <em>sql</em>=”SELECT * FROM 表名 WHERE 列名 LIKE ?”; query.setParameter(0,”%”+name+”%”);...
在Hibernate中使用sql原生语句
[color=red]Action:[/color] [code=&quot;java&quot;] List allNodesList = sysDepartmentService.findbySql(<em>sql</em>,&quot;ht.sys.model.SysDepartment&quot;); [/code] [color=red]Service:[/color] [code=&quot;java&quot;] public List fi...
HIbernate原生sql查询简单案例
在使用jeecms中运到的问题,今天总结出来。 <em>hibernate</em>的使用以及配置就不多说了。 dao层的部分代码如下 @SuppressWarnings("unchecked") public List findDataByQlr(String ywh, String qlrmc, String zjh) { List list = new ArrayList(); Str
hibernate执行原生sql的别名问题
当同一张表连接自己的时候,用别名读出同样的字段,后读的字段会和先读的字段一样,而不是应该的取值。 解决办法: 用AliasToEntityMapResultTransformer     Query query = session.createSQLQuery(<em>sql</em>Name);    query.setCacheable(false);    return query.s
hibernate 原生sql查询的结果集处理
主要是谈怎么拼装 转换结果 其中涉及的主要是怎么理解 Object[] ojbArr 这个是Object[] 是说结果集的每一列 是一个 Object数组。而不是说所有的结果集整个是个Object数组。 直接看我的代码例子吧,好理解些。 [code=&quot;java&quot;] @Transactional(propagation=Propagation.REQUIRED, rea...
hibernate 原生 sql 使用聚合函数的错误。
sum(sp.SUPP_PAY_AMOUNT) SUPP_PAY_AMOUNT,--此处<em>报错</em>rnsum(DISTINCT(SUPP_PAY_INTEREST)) SUPP_PAY_INTEREST, --无错误rnsum(DISTINCT(SUPP_PAY_FINDSOD)) SUPP_PAY_FINDSOD,--无错误rnconvert(bit,min(convert(int,SUPP_PAY_RESPONDENT))) SUPP_PAY_RESPONDENT,--无错误rnconvert(bit,min(convert(int,IN_SALARY))) SUPP_PAY_RESPONDENT,--无错误rn<em>hibernate</em> <em>报错</em>rnexception rnrnjavax.servlet.ServletException: java.lang.ArithmeticException: Rounding necessaryrn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rnrnrnroot cause rnrnjava.lang.ArithmeticException: Rounding necessaryrn java.math.BigDecimal.divideAndRound(Unknown Source)rn java.math.BigDecimal.setScale(Unknown Source)rn org.<em>hibernate</em>.type.BigIntegerType.get(BigIntegerType.java:35)rn org.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:113)rn org.<em>hibernate</em>.type.NullableType.nullSafeGet(NullableType.java:139)rn org.<em>hibernate</em>.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:183)rn org.<em>hibernate</em>.loader.Loader.getRowFromResultSet(Loader.java:595)rn org.<em>hibernate</em>.loader.Loader.doQuery(Loader.java:689)rn org.<em>hibernate</em>.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)rn org.<em>hibernate</em>.loader.Loader.doList(Loader.java:2145)rn org.<em>hibernate</em>.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn org.<em>hibernate</em>.loader.Loader.list(Loader.java:2024)rn org.<em>hibernate</em>.loader.custom.CustomLoader.list(CustomLoader.java:111)rn org.<em>hibernate</em>.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655)rn org.<em>hibernate</em>.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)rn org.<em>hibernate</em>.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)rn我的查询结果是返回List < Object []> 对象。如果没有SUPP_PAY_AMOUNT 结果程序不<em>报错</em>。就在有数据的时候就提示类型转换错误。我这也没有绑定entity。请大家帮忙看看rn
SSH中hibernate执行原生sql问题
使用SSH开发的项目,想在<em>hibernate</em>中执行<em>原生</em>的select语句,使用如下方法:rnString <em>sql</em>="select ...";rnConnection con=session.connection();rnStatement st=con.createStatement();rnResultSet rs=st.executeQuery(<em>sql</em>);rn...rnst.close();rnrs.close();rn现在的问题是,获取的connection不能关闭,一关闭的话,就抛异常了rnjava.<em>sql</em>.SQLException: You can't operate on a closed Connection!!!rn如果不关闭,等项目运行一段时间,数据库的链接就满了。rn请高手指点,此处该怎么办,到底需不需要关闭该connection,还有,此处的session应该是spring管理了的,从session中取出的connection到底是新获取的,还是怎么回事?谢谢rn
Hibernate中的查询:HQL、Criteria、原生SQl
Hibernate中的查询:HQL、Criteria、<em>原生</em>SQl的Demo,希望可以帮助大家理解Hibernate查询。
Hibernate 函数 ,子查询 和原生SQL查询
Hibernate 函数 ,子查询 和<em>原生</em>SQL查询。Hibernate 函数 ,子查询 和<em>原生</em>SQL查询
求Hibernate原生SQL (在spring容器下)
在spring容器下 <em>hibernate</em>框架的<em>原生</em>SQL怎么写 急在线等rn1.条件查询的怎么写?rn2.关联查询的怎么写?
hibernate + spring 拿原生sql返回字段
<em>sql</em>语句:rnrnSELECT trunc(ENERGYDATE,'mm') as QU, sum(energy) as ENERGY rnFROM DISTRIBUTIONBOXENERGYINFO where ENERGYDATE >= '"+y1+"' and ENERGYDATE ) order by QUrnrn<em>sql</em>语句能正确返回 现要拿那2个新命名的字段 qu 、ENERGYrn我用的是SSH2(HibernateTemplate )rn应该怎么拿?
hibernate原生sql查询出错!高手帮帮忙!
[b]下面是我的查询语句:[/b] rnselect top 5 theme.* from Theme theme where state=1 and type=1 order by newid() rnrn[b]下面是我的查询代码:[/b] rnpublic List lisst(String <em>sql</em>) rnSession sess=super.getSession(); rnQuery <em>sql</em>query=sess.createSQLQuery(<em>sql</em>).setEntity("theme",Theme.class); rnList ls=<em>sql</em>query.list(); rnsess.close(); rnreturn ls; rn rnrn[b]下面是我报的错:[/b] rnParameter theme does not exist as a named parameter in [select top 5 theme.* from Theme theme where state=1 and type=1 order by newid()] rn
Hibernate的HQL查询及原生sql查询语句写法
HQL语句查询,其中省略session的生成过程(从0开始set值) public String getHistorySqZc(String zxjxjhh,String jsh,String kch,String kxh, Long skjc, Long skxq, String oper) throws Exception {     String historyZc = nul
Hibernate 原生native sql支持 返回列名
今天在写一个action的时候发现,<em>hibernate</em>的<em>原生</em>的<em>sql</em>的查询的支持的确不太满足我的需求,特别的现在的<em>hibernate</em>5.2.6版本,其中去除掉了很多<em>原生</em>查询的支持,特别是setResultTransformer()方式的过时,使得我需要获取到<em>sql</em>返回的值带列名的需求化为泡影。 可喜的是<em>hibernate</em>5.2.6的版本中该setResultTransformer()方法虽然标记
hibernate原生sql查询及hql查询
如果使用<em>hibernate</em>的hql查询的,就要有相应的bean对象存在 如 [code=&quot;<em>sql</em>&quot;] select name,password from User [/code] 或者直接使用 [code=&quot;<em>sql</em>&quot;] from Users [/code] 其中 user是一对象bean,name和password分别是user对象bean中的属性。 可以使用 ...
Hibernate 使用原生SQL和实体之间的关联
有时候需要在几个表之间进行处理的时候,HIbernate就显得比较捉急,使用<em>原生</em>的SQL更加的好看。将查询的结果和实体关联起来,这种处理的方式也是比较不错的 查询返回的<em>原生</em>的实体对象 package com.hikvision.cms.modules.dataquery.domain;import java.io.Serializable; import java.<em>sql</em>.Timestamp; /*
hibernate中使用原生sql语句
注意:重点是在下面红色部分,兄弟们获得Connection后就知道怎么办了     Configuration cfg = new Configuration().configure();     System.out.println(&quot;加载配置文件成功!&quot;);     SessionFactory sessionFactory = cfg.buildSessionFactory();  ...
HIbernate 原生sql语句多表联合查询
多表查询最困惑的是查询出来的数据是两个表结合的所以数据没办法封装到一个实体中,个人总结了两种方法: 一:新建一个封装类: StringBuffer <em>sql</em> =new StringBuffer("select u.name , r.content , r.time " "FROM reply as r, user as u" "WHERE r.us...
Hibernate原生sql查询返回结果问题
Hibernate executeFind()返回值问题
解决Hibernate原生SQL映射问题
   感谢lf84730258的提醒,特别注明一下,下面的实例引用的是Hibernate3.2的包。     在问答里和论坛中,经常看到有人问,怎样将使用本地SQL查询出来的结果映射为值对象的问题,这里就Hibernate中提供的方法做个结论。前提,这里没有使用属性的延迟加载技术。     假设有个值对像,如下: package test; public class Pe...
hibernate _HQL查询多表查询与原生SQL查询
一:HQL查询(多表查询,但不复杂时使用)1、Hibernate独家查询语言 2、属于面向对象的查询语言 3、使用HSQL语句查询是,不能出现数据库相关的信息的1、基本查询2、条件查询1、?号占位符2、命名占位符3、分页查询4、映射查询1、java.lang.Object表示查询所有的表2、映射查询 需要实体类中必须有构造方法,并且构造方法的参数一致二:<em>原生</em>SQL查询(复杂的业务查询)1、基本查询...
hibernate查询之原生SQL查询多表
今天做了统计的需求,框架用的是<em>hibernate</em>.我写了一个<em>sql</em>如下: [code=&quot;java&quot;]String hql=&quot;select '事实个数' as statistictype,count(1) as statisticcount from ont_fact UNION&quot; + &quot; select '实例个数' as statistictype,count(1) as st...
Hibernate 原生SQL查询问题总结
HQL  查询SQL就不多说   Query query = getSession().createQuery(hql); List list = query.list(); getHibernateTemplate().find(hql, value);    <em>原生</em>SQL 查询   users表:id name age class_id score表:id user_i...
Hibernate的HQL和原生SQL返回简单对象
最近跟了一个技术经理,他有个要求就是所有的查询比结果都必需是对象,不是是map之类的,而且有很多对象的是很多实体相联合组成的对象,所有又专门研究了<em>hibernate</em>返回对象的知识这次讨论的对象都是组合对象,就是很多实体相关联,取他们一部分字段的组合对象,Hql首先扩展的对象package com.hfview.bean;import java.util.ArrayList; import java.
hibernate中使用原生sql查询
<em>hibernate</em>使用hql查询有诸多不便,比如无法在from后面使用select子查询,(貌似可以解决但是挺麻烦) 所以这里记录下自己找到的一些写法 首先拿到session对象:   |-  HibernateSessionFactory.getSession(); 这个类是我找的一个工具类,下面会附上工具代码,直接丢里面用就好了 最后在执行<em>sql</em>的时候有些不同 要使用 s
hibernatesql查询报错
createSQLQuery (<em>sql</em>),当执行这个语句<em>报错</em>时,一般是<em>sql</em>语句中的字段没有添加类型映射, 如Long  Double 类型等,这是用 addScalar(&quot;num&quot;,Hibernate.LONG) 就不会<em>报错</em>了                   dialect.jdbc.之类的错误 就是这个原因引起的...
[求助]用hibernate插入表单数据报错..
工具:myeclipsern数据库:my<em>sql</em>rn架构是:Struts+Sping+Hibernatern项目:学生选课系统rnrn//addstu.jsprnrnform是:xh,password,xm,yx,majorrnrn然后填充到AddstuFormrnrn_____________________________________________rn//AddstuFormAction的execute()方法rnrn AddstForm addstForm = (AddstForm) form;// TODO Auto-generated method stubrn Student stu=new Student();rn rn stu.setXh(addstForm.getXh());rn stu.setPassword(addstForm.getPassword());rn stu.setXm(addstForm.getXm());rn stu.setYx(addstForm.getYx());rn stu.setMajor(addstForm.getMajor());rn studentdao.save(stu); rn rn return mapping.findForward("succeed");rn______________________________________rnrnrn//StudentDAO.javarnrn public void save(Student transientInstance) rn log.debug("saving Student instance");rn try rn System.out.println("ssssssssss");rn getHibernateTemplate().save(transientInstance);rn log.debug("save successful");rn catch (RuntimeException re) rn log.error("save failed", re);rn throw re;rn rn rnrn---------------------rnrn★tomcat可以执行到System.out.println("ssssssssss");rn输出ssssssssssrnrnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: Hibernate operation: could not insert: [org.rockie.dao.Student]; bad SQL grammar [insert into stucourse__student (XH, PASSWORD, XM, YX, MAJOR) values (?, ?, ?, ?, ?)]; nested exception is java.<em>sql</em>.SQLException: Base table or view not found, message from server: "Table 'stucourse.stucourse__student' doesn't exist"rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnorg.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not insert: [org.rockie.dao.Student]; bad SQL grammar [insert into stucourse__student (XH, PASSWORD, XM, YX, MAJOR) values (?, ?, ?, ?, ?)]; nested exception is java.<em>sql</em>.SQLException: Base table or view not found, message from server: "Table 'stucourse.stucourse__student' doesn't exist"rn org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:224)rn org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)rn org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:411)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.execute(HibernateTemplate.java:371)rn org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:614)rn org.rockie.dao.StudentDAO.save(StudentDAO.java:36)rn org.rockie.action.AddstAction.execute(AddstAction.java:58)rn org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.rnrnrn
hibernate插入一个日期字符串报错
我把日期设为了String ,Oracle数据库中是Date类型,我按默认格式<em>插入</em>时间也不行 ,该怎么办?rn我不想在java中把日期设为Date类型!有办法解决吗?? 谢谢了!rn rn注:oracle中的默认格式是 yyyy-MM-dd HH:mm:ss 这种的 我在pl/<em>sql</em>下就能直接输字符串<em>插入</em>,rn但在java中 同样的字符串 就报下面的这个错!!rn rnInviteBookDaoImpl ibd=new InviteBookDaoImpl();rnSimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");rnString time=sdf.format(new Date());rnInviteBook ib=new InviteBook();rnib.setEndTime(time);rnibd.save(ib);rnrnrnorg.<em>hibernate</em>.exception.DataException: Could not execute JDBC batch updaternaused by: java.<em>sql</em>.BatchUpdateException: ORA-01861: 文字与格式字符串不匹配
Hibernate插入中文字符的记录到Mysql报错
1.现象用Navicat新建了一张user表,发现<em>插入</em>中文记录的时候插不进去.2.查看设置2.1Hibernate配置文件 jdbc:my<em>sql</em>://localhost:3306/elec?useUnicode=true&amp;characterEncoding=utf82.2数据库默认编码点
hibernate插入blob对象报错
我的 my<em>sql</em> 4.1的我用<em>hibernate</em> 3.0 直接<em>插入</em>一个blob对象程序片段如下:rnrnpublic void writeBLOB()rn Transaction tr=getSession().beginTransaction();rn TestBlob tb=new TestBlob();rn try rn InputStream in=new FileInputStream("E:\\MyProgram\\image\\bb.jpg");rn File file=new File("E:\\MyProgram\\image\\bb.jpg");rn tb.setBlob(Hibernate.createBlob(in,(int)file.length()));rn System.out.println("------OUT STREAM--");rn //in.close();rn getSession().save(tb);rn getSession().flush();rn getSession().refresh(tb);rn in.close(); rn tr.commit();rn catch (FileNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rnrn结果就是出错:rnCaused by: java.<em>sql</em>.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BLOB, ID) values (_binary'???à\0JFIF\0\0\0\0\0\0\0??\0C\0' at line 1rnrnrn那为帮帮忙这错是什么意思呀!rn谢谢rnrnrn
Hibernate 原生通用DAO
[保证可用] 仿照Spring中HibernateTemplate方法实现的简易DAO [原文链接] http://www.cnblogs.com/yzxk/p/4924287.html
关于hibernate原生查询
在用<em>hibernate</em>的<em>原生</em>查询时出现查不到值得问题,不<em>报错</em>。其中actionCount为数据库没有的字段,但已在po类中加入该属性,set/get方法也已添加rn代码如下:rn[code=java]rnpublic List searchCountList(PageBean pageBean, long productId,rn String createDate, long userId) rn String listHql = "select productid,action,count(*) as actionCount from tracetable where productid=? and createdate=? and userid=? group by productid,action";rn rn Session session = getHibernateTemplate().getSessionFactory().openSession();rn SQLQuery <em>sql</em>Query = session.createSQLQuery(listHql);rn <em>sql</em>Query.addEntity(DvbTraceTable.class);rn <em>sql</em>Query.setParameter(0, productId);rn <em>sql</em>Query.setParameter(1, createDate);rn <em>sql</em>Query.setParameter(2, userId);rn List traceTableList = <em>sql</em>Query.list();rn rn session.close();rn rn return traceTableList;rnrnrn[/code]rn断点调试时显示session已有值,参数也赋值。但到traceTableList 这一步获取不到值,不<em>报错</em>。求高手解答。
hibernate原生语句
<em>hibernate</em>的<em>原生</em><em>sql</em>查询是使用你自己写的而不是<em>hibernate</em>给你自动生成的。这样有什么好处嘞?<em>hibernate</em>在查询多张表时使用ManyToOne进行关联查询,而<em>hibernate</em>会发出多条语句严重拖慢系统效率。下面描述一下我对<em>hibernate</em><em>原生</em><em>sql</em>的了解。 代码准备: private SessionFactory sessionFactory;     publi
Hibernate 使用原生SQL 预编译过程中,插入字符串遇到SQL字符串错误
Hibernate代码错误实例 String <em>sql</em> = "update :tableName set colume = :colume where id = 1" Query querySQL = sessionFactory.getCurrentSession().createSQLQuery(<em>sql</em>); querySQL.setString("tableName","data"); query
原生sql语句和非原生
1.查 $<em>sql</em>='SELECT integral '. 'from ' . $this-&amp;amp;amp;amp;amp;amp;amp;amp;gt;pre . &amp;amp;amp;amp;amp;amp;amp;quot;goods where is_integral = 1 AND goods_id = '$goods_id'&amp;amp;amp;amp;amp;amp;amp;quot;; $
Hibernate原生SQL查询多表关联,SQL语句要注意的问题
总结: 1、使用Hibernate <em>原生</em>SQL查询,当多个表的关联时,或者返回多个表的字段时,最好要添加别名,并注意添加的别名的写法; 2.单表没问题,多表操作时,一定记得别名啊,最好不要 * ,写出具体的字段名。要不然,报异常字符越界,这异常是低层报出来的。很无语,所以用<em>hibernate</em>要规范才行。 执行如下的操作: 1> 使用<em>hibernate</em> 使用<em>原生</em>SQL查
hibernate 报错
出现如下错误:rnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: java.lang.NullPointerExceptionrn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn com.yourcompany.struts.action.ZhuceAction.execute(ZhuceAction.java:66)rn org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)rn org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.rnrnrn代码如下:rnZhuce Read = new Zhuce();rnRead.setName("name");rnZhuceDAO ZDao = new ZhuceDAO();rnTransaction tra = ZDao.getSession().beginTransaction();rnZDao.attachDirty(Read);rntra.commit();rnZDao.getSession().close();rnreturn null;
HIBERNATE报错
SERVICE================================rnpublic List save(List lists) rn List lis=new ArrayList();rn for(DBHtml onehtml:lists)rn DBHtml oldhtml=new DBHtml();rn oldhtml=htmlDao.findByID(onehtml.getId());rn oldhtml.setTitle(onehtml.getTitle());rn oldhtml.setUrl(onehtml.getUrl());rn lis.add(oldhtml);rn onehtml=null;rn oldhtml=null;rn rn return htmlDao.save(lis);rn rnDAOIMPL================================================rnrn public List save(List lists) rn this.getHibernateTemplate().saveOrUpdateAll(lists);rn System.out.println("===============================");rn return lists;rn rn错误rnrnorg.springframework.orm.<em>hibernate</em>3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.fs.po.DBHtml#4]; nested exception is org.<em>hibernate</em>.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.fs.po.DBHtml#4]rn at org.springframework.orm.<em>hibernate</em>3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)rn at org.springframework.orm.<em>hibernate</em>3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:424)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.saveOrUpdateAll(HibernateTemplate.java:764)rnrn求高手解决!
hibernate 报错!!!!!!!!!
页面<em>报错</em>,myeclipse的Console没有<em>报错</em>rnhibernante 的配置是使用myeclipse自动生成的。rn[code=text]rnjava.lang.reflect.InvocationTargetExceptionrn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:601)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn[/code]rnrn
hibernate报错
部分错误信息为:rn2013-4-1 22:03:01 org.apache.catalina.core.StandardContext reloadrn信息: Reloading Context with name [/stuinfomag] has startedrn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader clearReferencesThreadsrn严重: The web application [/stuinfomag] appears to have started a thread named [AWT-Windows] but has failed to stop it. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@ba8fce]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@3744bc]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@130500f]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@d8326d]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1d6b049]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1cfad77]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn2013-4-1 22:03:01 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksrn严重: The web application [/stuinfomag] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@1afe460]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@18590c5]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.rn22:03:02,335 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-default.xml]rn22:03:02,617 INFO XmlConfigurationProvider:42 - Unable to locate configuration files of the name struts-plugin.xml, skippingrn22:03:02,617 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-plugin.xml]rn22:03:02,632 INFO XmlConfigurationProvider:42 - Parsing configuration file [struts.xml]rn22:03:02,632 INFO BeanSelectionProvider:42 - Loading global messages from globalMessagesrn1405090311rn9780574084a579ea95b55ad454096c8ern22:03:07,391 INFO Environment:543 - Hibernate 3.3.1.GArn22:03:07,391 INFO Environment:576 - <em>hibernate</em>.properties not foundrn22:03:07,407 INFO Environment:709 - Bytecode provider name : javassistrn22:03:07,422 INFO Environment:627 - using JDK 1.4 java.<em>sql</em>.Timestamp handlingrn22:03:07,594 INFO Configuration:1460 - configuring from resource: /<em>hibernate</em>.cfg.xmlrn22:03:07,594 INFO Configuration:1437 - Configuration resource: /<em>hibernate</em>.cfg.xmlrn22:03:07,734 INFO Configuration:586 - Reading mappings from resource : com/jackc/bean/Student.hbm.xmlrnorg.<em>hibernate</em>.InvalidMappingException: Could not parse mapping document from resource com/jackc/bean/Student.hbm.xmlrn at org.<em>hibernate</em>.cfg.Configuration.addResource(Configuration.java:602)rn at org.<em>hibernate</em>.cfg.Configuration.parseMappingElement(Configuration.java:1621)rn at org.<em>hibernate</em>.cfg.Configuration.parseSessionFactory(Configuration.java:1589)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1568)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1542)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1462)rn at com.jackc.<em>hibernate</em>session.HibernateSessionFactory.(HibernateSessionFactory.java:17)rn at com.jackc.stu.dao.StudentDAO.login(StudentDAO.java:23)rn at com.jackc.stu.action.LoginAction.login(LoginAction.java:59)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn逛论坛,有人给出的答案说是id标签的出的问题,但是我改其他的值还是不行,之前几天又是能运行的,现在又不能运行了,困扰多天,望有人给出正解。
Hibernate报错
Hibernate: rn selectrn seq_user.nextval rn fromrn dualrn2012-3-1 15:30:07 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.<em>sql</em>.SQLException: ORA-02289: 序列不存在rnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)rn at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)rn at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)rn at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)rn at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)rn at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)rn at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)rn at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)rn at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)rn at org.<em>hibernate</em>.id.SequenceGenerator.generate(SequenceGenerator.java:75)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:535)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:523)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:519)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:693)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.doExecute(HibernateTemplate.java:419)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)rn at org.springframework.orm.<em>hibernate</em>3.HibernateTemplate.save(HibernateTemplate.java:690)rn at com.ssh.dao.UserDAO.save(UserDAO.java:13)rn at com.ssh.service.UserService.save(UserService.java:21)rn at com.ssh.action.UserAction.init(UserAction.java:32)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn已<em>插入</em>数据就<em>报错</em> 求解啊
hibernate报错。。。
08:33:30,031 ERROR DTDEntityResolver:72 - Don't use old DTDs, read the Hibernate 3.x Migration Guide!rn Hibernate: select seq.nextval from dualrnException in thread "main" org.<em>hibernate</em>.HibernateException: identifier of an instance of com.donna.model.Role was altered from 152 to 152rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:81)rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)rn at org.<em>hibernate</em>.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)rn at org.<em>hibernate</em>.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)rn at org.<em>hibernate</em>.impl.SessionImpl.flush(SessionImpl.java:1028)rn at org.<em>hibernate</em>.impl.SessionImpl.managedFlush(SessionImpl.java:366)rn at org.<em>hibernate</em>.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)rn at Test.test(Test.java:36)rn at Test.main(Test.java:21)rnrnrn===================================rnrnrnrnrn rn rn rn rn seqrn rn rn rn rn rn rnrn========================================rn请问这是什么原因啊。。。。
Hibernate报错!!!
[b]Cat实体[/b]rn[code=java]rnpackage com.jafee.app.domain;rnrnimport java.util.Date;rnrnimport javax.persistence.Column;rnimport javax.persistence.Entity;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.GenerationType;rnimport javax.persistence.Id;rnimport javax.persistence.JoinColumn;rnimport javax.persistence.ManyToOne;rnimport javax.persistence.Table;rnimport javax.persistence.Temporal;rnimport javax.persistence.TemporalType;rnrn@Entityrn@Table(name="t_cat")rnpublic class Cat rn @Idrn @GeneratedValue(strategy = GenerationType.AUTO)rn private Integer id;rn @Column(name = "name")rn private String name;rn @Column(name = "description")rn private String descrition;rn @ManyToOnern @JoinColumn(name = "mother_id")rn private Cat mother;rn @Temporal(TemporalType.TIMESTAMP)rn @Column(name = "createDate")rn private Date createDate;rn public Integer getId() rn return id;rn rn public void setId(Integer id) rn this.id = id;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public String getDescrition() rn return descrition;rn rn public void setDescrition(String descrition) rn this.descrition = descrition;rn rn public Cat getMother() rn return mother;rn rn public void setMother(Cat mother) rn this.mother = mother;rn rn public Date getCreateDate() rn return createDate;rn rn public void setCreateDate(Date createDate) rn this.createDate = createDate;rn rnrn[/code]rnrn[b]<em>hibernate</em>.cfg.xml[/b]rn[code=java]rnrnrnrnrnrn rnrn rn com.my<em>sql</em>.jdbc.Driverrn jdbc:my<em>sql</em>://127.0.0.1:3306/<em>hibernate</em>rn rootrn rootrnrn rn org.<em>hibernate</em>.dialect.MySQLDialectrnrn rn threadrnrn rn truernrn rn creaternrn rn rnrnrn[/code]rnrnHibernateUtilrn[code=java]rnpackage com.jafee.app.util;rnrnimport org.<em>hibernate</em>.SessionFactory;rnimport org.<em>hibernate</em>.cfg.Configuration;rnrnpublic class HibernateUtil rn private static final SessionFactory sessionFactory;rnrn static rn tryrn sessionFactory = new Configuration().configure().buildSessionFactory();rn catch(Throwable ex)rn System.out.println("Initial SessionFactory creation failed." + ex);rn throw new ExceptionInInitializerError(ex);rn rn rn rn public static SessionFactory getSessionfactory() rn return sessionFactory;rn rnrn[/code]rnrn[b]就是创建sessionFactory的时候出错了,我用的是3.6.0版本,所以用Configuration应该没问题吧,用AnnotationConfiguration反而会被提示过时的类。[/b]rnrn错误信息:rn[code=java]rnInitial SessionFactory creation failed.org.<em>hibernate</em>.MappingException: An AnnotationConfiguration instance is required to use rnException in thread "main" java.lang.ExceptionInInitializerErrorrn at com.jafee.app.util.HibernateUtil.(HibernateUtil.java:14)rn at com.jafee.app.manager.CatTest.main(CatTest.java:34)rnCaused by: org.<em>hibernate</em>.MappingException: An AnnotationConfiguration instance is required to use rn at org.<em>hibernate</em>.cfg.Configuration.parseMappingElement(Configuration.java:1634)rn at org.<em>hibernate</em>.cfg.Configuration.parseSessionFactory(Configuration.java:1589)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1568)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1542)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1462)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1448)rn at com.jafee.app.util.HibernateUtil.(HibernateUtil.java:11)rn ... 1 morernrn[/code]
Hibernate报错
%%%% Error Creating SessionFactory %%%%rnorg.<em>hibernate</em>.MappingException: invalid configurationrn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1535)rn at org.<em>hibernate</em>.cfg.Configuration.configure(Configuration.java:1476)rn at com.yu.factory.HibernateSessionFactory.(HibernateSessionFactory.java:30)rn at com.yu.<em>sql</em>Test.test.testQueryCard(test.java:16)rn at com.yu.<em>sql</em>Test.test.main(test.java:48)rnCaused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)rn at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)rn at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)rn at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)rn at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)rn at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)rn at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)rn at org.dom4j.io.SAXReader.read(SAXReader.java:465)rn at org.<em>hibernate</em>.cfg.Configuration.doConfigure(Configuration.java:1532)rn ... 4 morernrnrn配置文件我都检查了,好像没什么问题啊!但是就是报这个错。郁闷!麻烦各位帮忙解决下。
hibernate报错?
我的<em>hibernate</em>运行到这句就<em>报错</em>rnsessionFactory=new Configuration().configure("<em>hibernate</em>.cfg.xml").buildSessionFactory();rnrn错误信息:rnjava.lang.ExceptionInInitializerErrorrn All.HibernateUtil.(HibernateUtil.java:28)rn com.toshiba.servlet.addminRegisterServlet.doPost(addminRegisterServlet.java:71)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrn<em>hibernate</em>.cfg.xml文件:rnrnrnrnrnrnrn rn sarn rn jdbc:microsoft:<em>sql</em>server://localhost:3121;DatabaseName=Logisticsrn rn rn org.<em>hibernate</em>.dialect.SQLServerDialectrn rn conSQLrn sarn rn com.microsoft.jdbc.<em>sql</em>server.SQLServerDriverrn rn rn rn rn rn rn rn rn rnrn rnrn
SQL与原生SQL的区别
SQL 一般指根据指定的程序规则,自动生成的<em>sql</em>,比如最经典的,linq to <em>sql</em> 原理:对用户撰写的SQL进行一层包装,添加更多分析功能。 优势:在灵活分析的展现界面,还可以做排序,过滤,汇总等操作; 劣势:对SQL有书写要求,需要在用户<em>sql</em>中,显式申明别名;对SQL做多一层封装,对于某些数据库来说,可能效...
hibernate打印sql却没有插入数据库
刚学ssh遇到的问题,<em>hibernate</em>打印<em>sql</em>却没有<em>插入</em>数据库,一开始网上查了一下,大部分人说事务没有配置事务自动提交,但是设置true并没有解决问题,请论坛的各位大神不吝赐教,谢谢各位了~rn以下是代码rnrnrnrnrnrn rn rnrn rn rn rn rn rn rnrn rnrn rn rnrn rn rn rn org.<em>hibernate</em>.dialect.MySQLDialectrn truern truern updatern false rn rn org.<em>hibernate</em>.connection.C3P0ConnectionProviderrn rn 5rn 20rn 120rn 3000rn rn rnrn rn rn rn cn/itcast/user/User.hbm.xmlrn rn rn rnrn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn--------------------------------------------------------------------------------------------------------------rnimport org.springframework.orm.<em>hibernate</em>3.support.HibernateDaoSupport;rnrnrnpublic class UserDao extends HibernateDaoSupportrnrn rn rn public void save(User user) rn // TODO Auto-generated method stubrn this.getHibernateTemplate().save(user);rn rn rnrnrnrn--------------------------------------------------------------------------------------------------------------rnimport org.springframework.transaction.annotation.Transactional;rnrnimport utils.UUIDUtils;rnrn@Transactionalrnpublic class UserService rnrn private UserDao userDao;rnrn public void setUserDao(UserDao userDao) rn this.userDao = userDao;rn rnrn public void regist(User user) rn // TODO Auto-generated method stubrn user.setState(0);rn user.setCode(UUIDUtils.getUUID());rn userDao.save(user);rn rn rnrnrn-----------------------------------------------------------------------------------------------------rnrn控制台打印的结果:rnHibernate: rn insert rn intorn userrn (username, password, name, email, phone, addr, sex, state, code) rn valuesrn (?, ?, ?, ?, ?, ?, ?, ?, ?)rn
hibernate 插入sql 2000 ,很奇怪
本人用 <em>hibernate</em>自动生成的DAO层,通过过滤器 实现增删改查,其中出现了<em>插入</em>问题rn异常如下:rncould not insert: [com.nt.entity.Goods]rnjavax.servlet.ServletException: org.<em>hibernate</em>.exception.DataException: could not insert: [com.nt.entity.Goods]rn at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.nt.servlet.HibernateFilter.doFilter(HibernateFilter.java:40)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnCaused by: org.<em>hibernate</em>.exception.DataException: could not insert: [com.nt.entity.Goods]rn at org.<em>hibernate</em>.exception.SQLStateConverter.convert(SQLStateConverter.java:77)rn at org.<em>hibernate</em>.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.<em>hibernate</em>.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:250)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:535)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:523)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:519)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.<em>hibernate</em>.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)rn at $Proxy0.save(Unknown Source)rn at com.nt.dao.GoodsDAO.save(GoodsDAO.java:44)rn at com.nt.biz.impl.GoodsBizImpl.issueGoods(GoodsBizImpl.java:27)rn at com.nt.struts.action.IssueGoodsAction.execute(IssueGoodsAction.java:105)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn ... 20 morernCaused by: java.<em>sql</em>.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]将截断字符串或二进制数据。rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processErrorToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRPCRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReply(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.SQLServerImplStatement.getNextResultType(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)rn at org.<em>hibernate</em>.id.IdentityGenerator$InsertSelectDelegate.executeAndExtract(IdentityGenerator.java:108)rn at org.<em>hibernate</em>.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)rn ... 45 morern2009-5-10 14:03:17 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.<em>sql</em>.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]将截断字符串或二进制数据。rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processErrorToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRPCRequest.processReplyToken(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.tds.TDSRequest.processReply(Unknown Source)rn at com.microsoft.jdbc.<em>sql</em>server.SQLServerImplStatement.getNextResultType(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)rn at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)rn at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)rn at org.<em>hibernate</em>.id.IdentityGenerator$InsertSelectDelegate.executeAndExtract(IdentityGenerator.java:108)rn at org.<em>hibernate</em>.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)rn at org.<em>hibernate</em>.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)rn at org.<em>hibernate</em>.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)rn at org.<em>hibernate</em>.engine.ActionQueue.execute(ActionQueue.java:250)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)rn at org.<em>hibernate</em>.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)rn at org.<em>hibernate</em>.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn at org.<em>hibernate</em>.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)rn at org.<em>hibernate</em>.impl.SessionImpl.fireSave(SessionImpl.java:535)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:523)rn at org.<em>hibernate</em>.impl.SessionImpl.save(SessionImpl.java:519)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.<em>hibernate</em>.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)rn at $Proxy0.save(Unknown Source)rn at com.nt.dao.GoodsDAO.save(GoodsDAO.java:44)rn at com.nt.biz.impl.GoodsBizImpl.issueGoods(GoodsBizImpl.java:27)rn at com.nt.struts.action.IssueGoodsAction.execute(IssueGoodsAction.java:105)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.nt.servlet.HibernateFilter.doFilter(HibernateFilter.java:40)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rn
arm linux 内存映射.pdf下载
一个简单的嵌入式linux内存映射例子,包括静态映射和动态映射。 相关下载链接:[url=//download.csdn.net/download/hedoudou/2258761?utm_source=bbsseo]//download.csdn.net/download/hedoudou/2258761?utm_source=bbsseo[/url]
android应用权限详情下载
包含了android系统的大部分权限和说明,开发必须用到的 相关下载链接:[url=//download.csdn.net/download/zzyfengxiao/3368196?utm_source=bbsseo]//download.csdn.net/download/zzyfengxiao/3368196?utm_source=bbsseo[/url]
直纹面生成Ug二次开发下载
直纹面生成Ug二次开发 相关下载链接:[url=//download.csdn.net/download/qq_24896755/8309313?utm_source=bbsseo]//download.csdn.net/download/qq_24896755/8309313?utm_source=bbsseo[/url]
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法
我们是很有底线的