我有以下问题。我尝试在IBM WebSphere 9.0.0.9上运行我的应用程序。我的应用程序使用Spring Data。我有一个使用简单方法的非常简单的存储库:
public interface TerminalGroupRepository extends JpaRepository<TerminalGroup, String> {
List<TerminalGroup> findByNodeNodeIdIn(Collection<Long> nodeIds);
}
由于未知的原因,当我尝试在WebSphere上运行它时,抛出以下异常:
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.7.WAS-v20180710-6c446ab): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis
Error Code: 907
Call: SELECT t1.terminalgroupid, t1.DESCRIPTION, t1.NAME, t1.nodeid FROM dm_terminalgroup t1 LEFT OUTER JOIN node t0 ON (t0.nodeid = t1.nodeid) WHERE (t0.nodeid IN ((?,?)))
bind => [2 parameters bound]
Query: ReadAllQuery(referenceClass=TerminalGroup sql="SELECT t1.terminalgroupid, t1.DESCRIPTION, t1.NAME, t1.nodeid FROM dm_terminalgroup t1 LEFT OUTER JOIN node t0 ON (t0.nodeid = t1.nodeid) WHERE (t0.nodeid IN (?))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:684)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2061)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:586)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:261)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:262)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:248)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:319)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:715)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2772)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2725)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:559)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1175)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1134)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:460)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1222)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2899)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1863)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1845)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1810)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
... 158 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:747)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)
at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3822)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteQuery(WSJdbcPreparedStatement.java:1228)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:746)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
... 179 more
Caused by: Error : 907, Position : 155, Sql = SELECT t1.terminalgroupid, t1.DESCRIPTION, t1.NAME, t1.nodeid FROM dm_terminalgroup t1 LEFT OUTER JOIN node t0 ON (t0.nodeid = t1.nodeid) WHERE (t0.nodeid IN ((:1 ,:2 ))), OriginalSql = SELECT t1.terminalgroupid, t1.DESCRIPTION, t1.NAME, t1.nodeid FROM dm_terminalgroup t1 LEFT OUTER JOIN node t0 ON (t0.nodeid = t1.nodeid) WHERE (t0.nodeid IN ((?,?))), Error Msg = ORA-00907: missing right parenthesis
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
... 197 more
那里发生了什么?谢谢您的任何建议...
答案 0 :(得分:0)
In子句在EclipseLink中被破坏,并且在某种程度上它们仍然被破坏。
请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477和参考的问题。
Spring Data JPA的当前快照包含一个变通方法,只要您作为参数传递的集合不为空,该变通方法就应该起作用。
答案 1 :(得分:0)
我用另一种方式做到了,我用Query DSL实现了它。但是这样的错误令人沮丧...