From dev-return-15178-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Feb 24 13:48:49 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 93027 invoked from network); 24 Feb 2010 13:48:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 13:48:49 -0000 Received: (qmail 57452 invoked by uid 500); 24 Feb 2010 13:48:49 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 57404 invoked by uid 500); 24 Feb 2010 13:48:49 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 57320 invoked by uid 99); 24 Feb 2010 13:48:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 13:48:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 13:48:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1A63229A0014 for ; Wed, 24 Feb 2010 05:48:28 -0800 (PST) Message-ID: <1205854213.491181267019308106.JavaMail.jira@brutus.apache.org> Date: Wed, 24 Feb 2010 13:48:28 +0000 (UTC) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1401) Inheritance using Join Strategy may fail in cross join JPQL In-Reply-To: <1555840638.1259189859595.JavaMail.jira@brutus> 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/OPENJPA-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Donald Woods updated OPENJPA-1401: ---------------------------------- Affects Version/s: (was: 2.0.0) 2.0.0-M3 2.0.0-beta Fix Version/s: (was: 2.0.0) 2.0.0-beta2 > Inheritance using Join Strategy may fail in cross join JPQL > ----------------------------------------------------------- > > Key: OPENJPA-1401 > URL: https://issues.apache.org/jira/browse/OPENJPA-1401 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.0.0-M3, 2.0.0-beta > Reporter: Fay Wang > Assignee: Catalina Wei > Fix For: 1.3.0, 2.0.0-beta2 > > Attachments: OPENJPA-1401-testcase.jar, OPENJPA-1401.patch > > > Cross joining two entities with join table inheritance strategy may fail in the following test case: Contractor extends from Employee with Join table strategy. A JPQL "SELECT e FROM Department d, Contractor e where d.OID = e.dept.OID and d.description = 'Accounting' will fail with the exception below: > 3922 inheritance2 TRACE [main] openjpa.Query - Executing query: SELECT e FROM Department d, Contractor e where d.OID = e.dept.OID and d.description = 'IT' > 3969 inheritance2 TRACE [main] openjpa.jdbc.SQL - executing prepstmnt 24489446 SELECT t1.OID FROM Department t0 JOIN Contractor t1 ON (1 = 1) WHERE (t0.OID = t1.Dept_No AND t0.description = ?) [params=(String) IT] > 3969 inheritance2 TRACE [main] openjpa.jdbc.SQL - [0 ms] spent > 3984 inheritance2 TRACE [main] openjpa.jdbc.JDBC - [0 ms] close > Exception in thread "main" org.apache.openjpa.persistence.PersistenceException: Employee: e ({e|Contractor=1, Department=0}) > at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4677) > at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4630) > at org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:539) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:138) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70) > at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155) > at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.handleCheckedException(QueryImpl.java:2068) > at org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:150) > at org.apache.openjpa.lib.rop.AbstractNonSequentialResultList$Itr.hasNext(AbstractNonSequentialResultList.java:171) > at org.apache.openjpa.lib.rop.ResultListIterator.hasNext(ResultListIterator.java:53) > at org.apache.openjpa.kernel.DelegatingResultList$DelegatingListIterator.hasNext(DelegatingResultList.java:391) > at inheritance2.TestInheritance2.main(TestInheritance2.java:71) > Caused by: java.sql.SQLException: Employee: e ({e|Contractor=1, Department=0}) > at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.findObject(SelectImpl.java:2402) > at org.apache.openjpa.jdbc.sql.ResultSetResult.translate(ResultSetResult.java:497) > at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:362) > at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:696) > at org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy.getPrimaryKeyValue(PrimitiveFieldStrategy.java:300) > at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:187) > at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:146) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:941) > at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280) > at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2328) > at org.apache.openjpa.jdbc.kernel.exps.PCPath.load(PCPath.java:890) > at org.apache.openjpa.jdbc.kernel.exps.PCPath.load(PCPath.java:873) > at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(ProjectionResultObjectProvider.java:79) > at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2032) > at org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:131) > ... 4 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.