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 84E3510E0B for ; Fri, 25 Oct 2013 19:03:39 +0000 (UTC) Received: (qmail 93149 invoked by uid 500); 25 Oct 2013 19:02:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 92929 invoked by uid 500); 25 Oct 2013 19:02:38 -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 92856 invoked by uid 99); 25 Oct 2013 19:02:30 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Oct 2013 19:02:30 +0000 Date: Fri, 25 Oct 2013 19:02:30 +0000 (UTC) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-2018) Cannot bind String[] to ParameterExpression for path.in(parameter) 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-2018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13805593#comment-13805593 ] Rick Curtis commented on OPENJPA-2018: -------------------------------------- [~struberg] -- It looks like you committed an earlier version of Romain's patch, but I still have a couple issues with it (the latest version). + "javax.persistence.provider", PersistenceProviderImpl.class.getName(), + "openjpa.RuntimeUnenhancedClasses", "supported", + "openjpa.ConnectionURL", "jdbc:derby:memory:openjpa2018;create=true", + "openjpa.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver"); + em = emf.createEntityManager(); #1) RuntimeUnenhancedClasses is a feature we always tell users to stay away from. We should NEVER condone it's usage. It is buggy, and should have never made it into the codebase. #2) Don't specify database connection details in the test setup method. These properties will be passed in at runtime via Maven, or if running in Eclipse, via SystemProperties. #3) You shouldn't need to specify the persistence provider implementation class. > Cannot bind String[] to ParameterExpression for path.in(parameter) > ------------------------------------------------------------------ > > Key: OPENJPA-2018 > URL: https://issues.apache.org/jira/browse/OPENJPA-2018 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Affects Versions: 2.1.0 > Reporter: Oliver Gierke > Assignee: Michael Dick > Labels: binding, criteria_api, jpa > Attachments: missingpatch.patch, OPENJPA-2018.patch, OPENJPA-2018-test-update.patch, OPENJPA-2018-with-array.patch, openjpa-2018.zip > > > Given the following code: > {code} > User user = new User("Dave", "Matthews", "foo@bar.de"); > em.persist(user); > em.flush(); > CriteriaBuilder builder = em.getCriteriaBuilder(); > CriteriaQuery criteria = builder.createQuery(User.class); > Root root = criteria.from(User.class); > criteria.where(root.get("firstname").in(builder.parameter(String[].class))); > TypedQuery query = em.createQuery(criteria); > for (ParameterExpression parameter : criteria.getParameters()) { > query.setParameter(parameter, new String[] {"Dave", "Carter"}); > } > List result = query.getResultList(); > assertThat(result.isEmpty(), is(false)); > {code} > I get a > {code} > org.apache.openjpa.persistence.ArgumentException: The specified parameter of type "class [Ljava.lang.String;" is not a valid query parameter. > {code} > Using {{Collection}} as {{ParameterExpression}} type and binding the parameters via {{Arrays.asList(...)}} works fine. -- This message was sent by Atlassian JIRA (v6.1#6144)