Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4CEA210C39 for ; Mon, 1 Jul 2013 21:05:20 +0000 (UTC) Received: (qmail 70690 invoked by uid 500); 1 Jul 2013 21:05:20 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 70671 invoked by uid 500); 1 Jul 2013 21:05:20 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 70663 invoked by uid 99); 1 Jul 2013 21:05:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 21:05:20 +0000 Date: Mon, 1 Jul 2013 21:05:20 +0000 (UTC) From: "Thomas Fox (JIRA)" To: torque-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (TORQUE-291) SetAndSaveXXX method does not work for empty list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TORQUE-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Fox updated TORQUE-291: ------------------------------ Component/s: (was: Generator) Templates > SetAndSaveXXX method does not work for empty list > ------------------------------------------------- > > Key: TORQUE-291 > URL: https://issues.apache.org/jira/browse/TORQUE-291 > Project: Torque > Issue Type: Bug > Components: Templates > Affects Versions: 4.0 > Reporter: Thomas Fox > Assignee: Thomas Fox > > A setandSave method is called with an empty list. > This generates an empty in clause in the executed sql, resulting in an sql exception. > Sample stacktrace for Derby: > org.apache.torque.TorqueException: java.sql.SQLException: Syntax error: Encountered ")" at line 1, column 181. > at org.apache.torque.util.ExceptionMapperImpl.toTorqueException(ExceptionMapperImpl.java:59) > at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:1068) > at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:680) > at org.apache.torque.test.peer.base.BaseNullableOIntegerFkPeer.doSelect(BaseNullableOIntegerFkPeer.java:305) > at org.apache.torque.test.peer.base.BaseOIntegerPkPeerImpl.setAndSaveNullableOIntegerFks(BaseOIntegerPkPeerImpl.java:2898) > at org.apache.torque.test.peer.base.BaseOIntegerPkPeerImpl.setAndSaveNullableOIntegerFks(BaseOIntegerPkPeerImpl.java:2830) > at org.apache.torque.test.peer.base.BaseOIntegerPkPeer.setAndSaveNullableOIntegerFks(BaseOIntegerPkPeer.java:2068) > at org.apache.torque.generated.peer.SetAndSaveTest.testSetAndSaveEmptyList(SetAndSaveTest.java:524) > 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:592) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) > Caused by: java.sql.SQLException: Syntax error: Encountered ")" at line 1, column 181. > at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) > at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.(Unknown Source) > at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source) > at org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.prepareStatement(PooledConnectionImpl.java:243) > at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.prepareStatement(ConnectionImpl.java:95) > at org.apache.torque.util.BasePeerImpl.doSelect(BasePeerImpl.java:979) > ... 24 more > Caused by: ERROR 42X01: Syntax error: Encountered ")" at line 1, column 181. > at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) > at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source) > at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) > at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) > at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source) > ... 33 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org