Bug 512386: JPQL initialization constructor doesnt support CONCAT
Signed-off-by: Will Dazey <dazeydev.3@gmail.com>
Reviewed-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/ExpressionBuilderVisitor.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/ExpressionBuilderVisitor.java
index 4b7a4c1..b9fea43 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/ExpressionBuilderVisitor.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/ExpressionBuilderVisitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -10,6 +10,8 @@
* Contributors:
* Oracle - initial API and implementation
*
+ * 04/11/2017-2.6 Will Dazey
+ * - 512386: Concat expression return type Boolean -> String
******************************************************************************/
package org.eclipse.persistence.internal.jpa.jpql;
@@ -806,7 +808,7 @@
queryExpression = newExpression;
// Set the expression type
- type[0] = Boolean.class;
+ type[0] = String.class;
}
/**
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
index f517569..9f5586e 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -9,6 +9,9 @@
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
+ *
+ * 04/11/2017-2.6 Will Dazey
+ * - 512386: Add constructor initialization with CONCAT test
******************************************************************************/
package org.eclipse.persistence.testing.tests.jpa.jpql;
@@ -3589,6 +3592,8 @@
query.getResultList();
query = em.createQuery("Select new org.eclipse.persistence.testing.tests.jpa.jpql.JUnitJPQLComplexTestSuite.EmployeeDetail(MAX(e.firstName), MAX(e.lastName)) from Employee e");
query.getResultList();
+ query = em.createQuery("Select new org.eclipse.persistence.testing.tests.jpa.jpql.JUnitJPQLComplexTestSuite.EmployeeDetail(CONCAT(e.firstName, '_', e.lastName), e.lastName) from Employee e");
+ query.getResultList();
query = em.createQuery("Select 1 from Employee e");
query.getResultList();
// Bug#354344