Well, i've tried this and i'm getting the following exception. I don't know why this exception is thrown because there is no "(" inside the query....
Code:
[2007-03-18 23:28:08,828 DEBUG] JDBCExceptionReporter (SAPEngine_Application_Thread[impl:3]_0) > could not execute query [select customerco0_.CUSTID as CUSTID26_0_, areas1_.AREAID as AREAID27_1_, customerco0_.CUSTOMERNAME as CUSTOMER2_26_0_, areas1_.CUSTID as CUSTID27_1_, areas1_.AREANAME as AREANAME27_1_, areas1_.custid as custid0__, areas1_.AREAID as AREAID0__ from CUST_CONFIG customerco0_, CUST_CONFIG_AREAS areas1_ where customerco0_.CUSTID=areas1_.custid(+) and customerName=? and customerco0_.CUSTID=areas1_.CUSTID]
com.sap.sql.log.OpenSQLException: The SQL statement "select customerco0_.CUSTID as CUSTID26_0_, areas1_.AREAID as AREAID27_1_, customerco0_.CUSTOMERNAME as CUSTOMER2_26_0_, areas1_.CUSTID as CUSTID27_1_, areas1_.AREANAME as AREANAME27_1_, areas1_.custid as custid0__, areas1_.AREAID as AREAID0__ from CUST_CONFIG customerco0_, CUST_CONFIG_AREAS areas1_ where customerco0_.CUSTID=areas1_.custid(+) and customerName=? and customerco0_.CUSTID=areas1_.CUSTID" contains the syntax error[s]: SQL syntax error: the token "(" was not expected here
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.parse(StatementAnalyzerImpl.java:77)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:125)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:109)
at com.sap.sql.jdbc.common.AbstractCommonStatement.parseStatement(AbstractCommonStatement.java:360)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement(CommonConnectionImpl.java:350)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:81)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.plecto.bimarp.ext.dba.impl.HibernatePersistenceManager.executeQuery(HibernatePersistenceManager.java:182)
at com.plecto.bimarp.ejb.dba.DatabaseAccessBean.executeQuery(DatabaseAccessBean.java:84)
at com.plecto.bimarp.ejb.dba.DatabaseAccessLocalLocalObjectImpl0_0.executeQuery(DatabaseAccessLocalLocalObjectImpl0_0.java:319)
at com.plecto.bimarp.ejb.configuration.ConfigurationHandlerBean.getConfig(ConfigurationHandlerBean.java:92)
at com.plecto.bimarp.ejb.configuration.ConfigurationHandlerLocalLocalObjectImpl0_0.getConfig(ConfigurationHandlerLocalLocalObjectImpl0_0.java:103)
at com.plecto.bimarp.ejb.test.TestEJBBean.testConfigurationModule(TestEJBBean.java:115)
at com.plecto.bimarp.ejb.test.TestEJBObjectImpl0_0.testConfigurationModule(TestEJBObjectImpl0_0.java:119)
at com.plecto.bimarp.ejb.test.TestEJB_Stub.testConfigurationModule(TestEJB_Stub.java:56)
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 com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy122.testConfigurationModule(Unknown Source)
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 com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.sql.sqlparser.CommonSQLParserException: SQL syntax error: the token "(" was not expected here
I wonder, why hibernate includes this (+) after ids, never saw it anywhere. I think maybe that's the problem, but didn't find any solution.
I've tried different types of this query:
"FROM CustomerConfiguration as c left join fetch c.areas"
"FROM CustomerConfiguration as c left join fetch c.areas as a left join fetch a.sra as s"
All queries throw the same exception...
btw: In the mapping file i changed the fetch attribute to "select".