Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-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 0786A17ADD for ; Tue, 17 Feb 2015 08:15:12 +0000 (UTC) Received: (qmail 20254 invoked by uid 500); 17 Feb 2015 08:15:11 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 20138 invoked by uid 500); 17 Feb 2015 08:15:11 -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 20127 invoked by uid 99); 17 Feb 2015 08:15:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 08:15:11 +0000 Date: Tue, 17 Feb 2015 08:15:11 +0000 (UTC) From: "leonardo kenji shikida (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (OPENJPA-2569) QBE is not using the right column name in join MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 leonardo kenji shikida created OPENJPA-2569: ----------------------------------------------- Summary: QBE is not using the right column name in join Key: OPENJPA-2569 URL: https://issues.apache.org/jira/browse/OPENJPA-2569 Project: OpenJPA Issue Type: Bug Components: jpa Affects Versions: 2.3.0 Environment: tomee+ 1.6.0 stable Reporter: leonardo kenji shikida I have a query like this public List qbe(E example) { OpenJPACriteriaBuilder cb = (OpenJPACriteriaBuilder) entityManager.getCriteriaBuilder(); CriteriaQuery q = cb.createQuery(clazz); Root entity = q.from(clazz); q.where(cb.qbe(entity, example)); // query by example q.select(entity); TypedQuery tq = entityManager.createQuery(q); return tq.getResultList(); } for entities like this @Entity @Table(name="APPUSER",uniqueConstraints=@UniqueConstraint(columnNames={"username"})) public class User implements Serializable{ /** * */ private static final long serialVersionUID = 4411272750939441365L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; (...) and this @Entity public class PasswordRotationJob implements Serializable{ (...) @ManyToOne @JoinColumn(name="userId") private User submitter; The QBE query seems to assume a wrong column name Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00904: "T1"."USERID": invalid identifier {prepstmnt 1347119244 SELECT t0.id,(...), t1.id, (...), t2.id, (...) FROM PasswordRotationJob t0, APPUSER t1, (...) WHERE (...) AND t0.userId = t1.userId(+) (...)} [code=904, state=42000] -- This message was sent by Atlassian JIRA (v6.3.4#6332)