我现在的项目用的是Tapestry3.0+Spring+Hibernate2.0+orcale9i,DEBUG是我生成的SQL语句,我发现我的SQL是后面(to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ( select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from Fare f where 1=1 and f.batchId = :batchId) 这里错了,各位,是不是Hibernate hsql 里的 in 不支持select query:我它改为(to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ('','')就可以了:经过测试,发现这句select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from Fare f where 1=1 and f.batchId = :batchId不对好像不支持上面红色字体的,但是我想实现...该如何实现
指点迷津,谢谢,下面是错误信息:
DEBUG (FaresManagement.java:249) - 生成的SQL语句是:select e.uuid,e.batchId,e.fareNumber,e.groupId,e.comType,e.effDate,e.endDate,e.approvedDate,e.baseComm,e.baseType from GroupFare e where e.endDate is null and e.batchId = :batchId and e.groupId = :groupId and (to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ( select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from Fare f where 1=1 and f.batchId = :batchId)
org.springframework.orm.hibernate.HibernateQueryException: , expected in SELECT [select count(*) from com.footmarktech.domain.groups.GroupFare e where e.endDate is null and e.batchId = :batchId and e.groupId = :groupId and (to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ( select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from com.footmarktech.domain.groups.Fare f where 1=1 and f.batchId = :batchId)]; nested exception is net.sf.hibernate.QueryException: , expected in SELECT [select count(*) from com.footmarktech.domain.groups.GroupFare e where e.endDate is null and e.batchId = :batchId and e.groupId = :groupId and (to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ( select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from com.footmarktech.domain.groups.Fare f where 1=1 and f.batchId = :batchId)]
net.sf.hibernate.QueryException: , expected in SELECT [select count(*) from com.footmarktech.domain.groups.GroupFare e where e.endDate is null and e.batchId = :batchId and e.groupId = :groupId and (to_char(e.fareNumber) || to_char(e.approvedDate,'yyyy-mm-dd hh24:mi:ss')) in ( select to_char(f.fareNumber) || to_char(f.approvedDate,'yyyy-mm-dd hh24:mi:ss') from com.footmarktech.domain.groups.Fare f where 1=1 and f.batchId = :batchId)]
at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:169)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:124)
at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:220)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:142)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1572)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
at com.footmarktech.persistence.hibernate.BaseDAOHibernate$3.doInHibernate(BaseDAOHibernate.java:164)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:293)
at com.footmarktech.persistence.hibernate.BaseDAOHibernate.find(BaseDAOHibernate.java:139)
at common.tapestry.jwc.BaseDaoTableModel.getRowCount(BaseDaoTableModel.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:904)
at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:54)
at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:122)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616)
at ognl.ASTProperty.getValueBody(ASTProperty.java:96)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.ASTChain.getValueBody(ASTChain.java:109)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.ASTNotEq.getValueBody(ASTNotEq.java:49)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.Ognl.getValue(Ognl.java:333)
at ognl.Ognl.getValue(Ognl.java:310)
at org.apache.tapestry.binding.ExpressionBinding.resolveProperty(ExpressionBinding.java:201)
at org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:194)
at org.apache.tapestry.binding.AbstractBinding.getBoolean(AbstractBinding.java:77)
at org.apache.tapestry.param.BooleanParameterConnector.setParameter(BooleanParameterConnector.java:51)
at org.apache.tapestry.param.ParameterManager.setParameters(ParameterManager.java:105)
at org.apache.tapestry.AbstractComponent.prepareForRender(AbstractComponent.java:898)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:853)
at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
at org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:45)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
at org.apache.tapestry.html.Body.renderComponent(Body.java:269)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
at org.apache.tapestry.html.Shell.renderComponent(Shell.java:124)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
at org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
at org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:368)
at org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:749)
at com.footmarktech.web.FootmarkEngine.renderResponse(FootmarkEngine.java:413)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:174)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:889)
at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)
at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
分享到:
- 2007-11-06 09:44
- 浏览 2132
- 评论(0)
- 论坛回复 / 浏览 (0 / 1988)
- 查看更多
相关推荐
【标题】"用maven构建SpringMVC+JPA+Hibernate+Hsql+jetty的web项目"涉及了多个核心的Java Web开发技术,这里我们将深入探讨这些技术以及如何将它们整合到一起。 1. Maven:Maven是Apache的一个开源项目,它是一个...
采用三层架构和HSQL数据库编写的java web,表示层用到的是struts2.0控制jsp页面的内容显示,数据持久层用的是Hibernate(ORM,对象-关系映射)对数据库是的数据进行操作,业务逻辑层用的是spring3.02对该程序进行业务...
博文链接:https://xuliangyong.iteye.com/blog/79089
HSQL(Hibernate Query Language)是一种强大且灵活的查询语言,用于查询Hibernate应用程序中的数据。下面将对HSQL的基本语法和使用方法进行详细介绍。 1. 大小写敏感性问题 HSQL查询语句对大小写并不敏感,除了...
项目主要分为7个model模块,配置模块(config),注册模块(discovery),监控模块(monitor),服务模块_mybatisService(通过mybatis操作mysql),服务模块_person(通过hibernate操作hsql),服务模块_some(通过...
例如,使用JUnit和Hibernate等框架,可以在测试前初始化数据库状态,测试后清理数据。 总结,HSQL Database是一款强大的、适用于Java开发的数据库系统,具有轻量级、高性能、易用性等优点。在Java项目中,无论是...
Hibernate 更新某些字段 Hibernate 是一个基于 Java 的 ORM 框架,它提供了对数据库的操作接口。在实际开发中,我们经常需要更新数据库中的某些字段,而不是所有字段。那么,如何使用 Hibernate 实现更新某些字段呢...
如何使用hsql数据库
HSQL(HyperSQL)是一种轻量级、高性能的关系型数据库管理系统,它支持SQL标准并提供了多种运行模式,包括单用户模式、嵌入式模式和服务器模式。HSQL因其小巧、快速和易于使用而受到开发者们的青睐,尤其适用于开发...
《HSQL数据库安装部署使用详解》 HSQL(HyperSQL)是一种轻量级、高性能的关系型数据库管理系统,常用于开发测试环境或者嵌入式应用。本文将详细介绍HSQL的安装、部署以及使用过程,帮助您顺利搭建并操作HSQL数据库...
在本篇博文中,我们将深入探讨Spring框架在数据库访问方面的应用,特别关注使用HSQL内存数据库的实践。HSQL数据库是一种轻量级的关系型数据库管理系统,适用于开发测试和快速原型设计,因为它不需要独立服务器进程,...
在探讨Hibernate中所有数据库方言之前,我们先简要回顾一下Hibernate框架本身。Hibernate是一个开源的对象关系映射(ORM)框架,用于Java应用与各种关系型数据库进行交互。它提供了强大的功能,如对象持久化、查询...
### Pentaho HSQL连接教程 #### 一、前言 Pentaho BI Suite是一款非常强大的商业智能工具,它集成了数据集成、报表设计、仪表板展示等多种功能。本教程将详细介绍如何在Pentaho BI Suite中连接到HSQLDB(HyperSQL ...
HSQL(HyperSQL)是一个开源的关系型数据库管理系统,它支持内存模式和文件模式,能够处理文本格式的数据,如CSV(逗号分隔值)文件。在本篇笔记中,我们将探讨如何使用HSQL处理文本数据库,特别是如何导入和操作CSV...
<property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost ``` HSQLDB是一个轻量级的内嵌式数据库,适合测试环境使用。 ###### 3.2.2 MySQL ```xml <property name="hibernate.dialect">org....
- 前言:本章节旨在引导初学者熟悉Hibernate的基本概念和操作,通过一个简单的命令行应用开始,使用HSQL DB作为内存数据库,无需安装额外的数据库服务器。 - 开发环境准备:首先,你需要创建一个开发目录,将...
结合Hibernate数据库无关的特性,非常适合在项目开发的时候使用。 2. 作为单元测试数据库。单元测试的时候,启动HSQLDB的file模式,数据不存盘,可以保证测试原子性。 3. 来回复制,随身携带。 4. 不...