diff --git a/antbuild.xml b/antbuild.xml index 226c68be58b..976c2e22e7d 100644 --- a/antbuild.xml +++ b/antbuild.xml @@ -1581,10 +1581,10 @@ - + - + diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/distributedservers/rcm/jgroups/JGroupsConfigurationTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/distributedservers/rcm/jgroups/JGroupsConfigurationTest.java index edcc389cc0c..147d01bb851 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/distributedservers/rcm/jgroups/JGroupsConfigurationTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/distributedservers/rcm/jgroups/JGroupsConfigurationTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -19,7 +20,6 @@ import org.eclipse.persistence.sessions.coordination.RemoteCommandManager; import org.eclipse.persistence.sessions.coordination.TransportManager; import org.eclipse.persistence.testing.tests.distributedservers.rcm.ConfigurableCacheSyncDistributedTest; -import org.junit.Assert; import java.lang.reflect.Field; @@ -38,9 +38,9 @@ protected void test() throws Throwable { RemoteConnection connection = transport.getConnectionToLocalHost(); try { int multicastPort = getMulticastPort(connection); - Assert.assertEquals("Default multicast port different than expected", 45588, multicastPort); + assertEquals("Default multicast port different than expected", 45588, multicastPort); } catch (Exception x) { - Assert.fail("Failed to retrieve multicast port: " + x.getMessage()); + fail("Failed to retrieve multicast port: " + x.getMessage()); } finally { connection.close(); } @@ -53,9 +53,9 @@ protected void test() throws Throwable { connection = transport.getConnectionToLocalHost(); try { int multicastPort = getMulticastPort(connection); - Assert.assertEquals("Configured multicast port different than expected", 45678, multicastPort); + assertEquals("Configured multicast port different than expected", 45678, multicastPort); } catch (Exception x) { - Assert.fail("Failed to retrieve multicast port: " + x.getMessage()); + fail("Failed to retrieve multicast port: " + x.getMessage()); } finally { connection.close(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKeyTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKeyTestSuite.java index 12010252c17..f4999967d91 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKeyTestSuite.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKeyTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,7 +25,6 @@ //JUnit4 imports import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -90,7 +90,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) { @Override public DynamicEntity createSimpleInstance(Session session, int id) { DynamicType simpleEntityType = dynamicHelper.getType("Simple"); - Assert.assertNotNull(simpleEntityType); + assertNotNull(simpleEntityType); DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity(); simpleInstance.set("id1", id); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeTestSuite.java index 9a2ab752b04..2a50bd59b52 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeTestSuite.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -25,7 +26,6 @@ //JUnit4 imports import org.junit.After; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -162,7 +162,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) { public DynamicEntity createSimpleInstance(Session session, int id) { DynamicType simpleEntityType = dynamicHelper.getType("Simple"); - Assert.assertNotNull(simpleEntityType); + assertNotNull(simpleEntityType); DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity(); simpleInstance.set("id", id); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeWithEnumTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeWithEnumTestSuite.java index b0f9b13c078..332c4043315 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeWithEnumTestSuite.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeWithEnumTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,6 @@ //JUnit4 imports import org.junit.After; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -174,7 +174,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) { public DynamicEntity createSimpleInstance(Session session, int id) { DynamicType simpleEntityType = dynamicHelper.getType("Simple"); - Assert.assertNotNull(simpleEntityType); + assertNotNull(simpleEntityType); DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity(); simpleInstance.set("id", id); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java index f507fb1118d..ec5d68878b2 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -38,7 +39,6 @@ import org.eclipse.persistence.sessions.UnitOfWork; import org.junit.After; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -147,7 +147,7 @@ public void verifyConfig() throws Exception { @Test public void verifyProperties() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); assertEquals(4, simpleTypeA.getNumberOfProperties()); assertEquals("id", simpleTypeA.getPropertiesNames().get(0)); @@ -159,7 +159,7 @@ public void verifyProperties() { @Test public void createSimpleA() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicEntity a = simpleTypeA.newDynamicEntity(); @@ -179,7 +179,7 @@ public void createSimpleA() { @Test public void persistSimpleA() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity(); simpleInstance.set("id", 1); @@ -193,7 +193,7 @@ public void persistSimpleA() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); } @Test @@ -201,7 +201,7 @@ public void verifyChangTracking() { persistSimpleA(); DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); UnitOfWork uow = session.acquireUnitOfWork(); @@ -227,11 +227,11 @@ public void verifyChangTracking() { @Test public void createSimpleAwithSimpleB() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicType simpleTypeB = dynamicHelper.getType("SimpleB"); - Assert.assertNotNull(simpleTypeB); + assertNotNull(simpleTypeB); - Assert.assertNotNull(session.getDescriptorForAlias("SimpleB")); + assertNotNull(session.getDescriptorForAlias("SimpleB")); DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity(); simpleInstanceB.set("value2", true); @@ -251,7 +251,7 @@ public void createSimpleAwithSimpleB() { countQuery.setShouldReturnSingleValue(true); int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCountA); + assertEquals(1, simpleCountA); } } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java index a21cb682e33..1783bd0c7a3 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,6 @@ import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -import org.junit.Assert; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -141,7 +141,7 @@ public void createSimpleA() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); } @Test @@ -158,7 +158,7 @@ public void createSimpleB() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); } @Test @@ -181,13 +181,13 @@ public void createAwithB() { countQueryB.addCount(); countQueryB.setShouldReturnSingleValue(true); int simpleCountB = ((Number) session.executeQuery(countQueryB)).intValue(); - Assert.assertEquals(1, simpleCountB); + assertEquals(1, simpleCountB); ReportQuery countQueryA = dynamicHelper.newReportQuery("SimpleA", new ExpressionBuilder()); countQueryA.addCount(); countQueryA.setShouldReturnSingleValue(true); int simpleCountA = ((Number) session.executeQuery(countQueryA)).intValue(); - Assert.assertEquals(1, simpleCountA); + assertEquals(1, simpleCountA); } @Ignore diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java index 510fca8d5db..e4087351ad0 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,7 +37,6 @@ import org.eclipse.persistence.sessions.UnitOfWork; import org.junit.After; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -122,7 +122,7 @@ public void verifyConfig() throws Exception { @Test public void verifyProperties() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); assertEquals(6, simpleTypeA.getNumberOfProperties()); assertTrue(simpleTypeA.getPropertiesNames().contains("id")); @@ -143,23 +143,23 @@ public void verifyProperties() { @Test public void createSimpleA() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicEntity a = simpleTypeA.newDynamicEntity(); assertNotNull(a); assertEquals(((Number) a.get("id")).intValue(), 0); assertFalse(a.isSet("value1")); - assertEquals(a.get("value2"), false); + assertEquals(false, a.get("value2")); assertFalse(a.isSet("value3")); - assertEquals(((Number) a.get("value4")).doubleValue(), 0.0, 0.01); + assertEquals(0.0, ((Number) a.get("value4")).doubleValue(), 0.01); assertFalse(a.isSet("value5")); } @Test public void persistSimpleA() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity(); simpleInstance.set("id", 1); @@ -173,7 +173,7 @@ public void persistSimpleA() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); session.release(); } @@ -182,7 +182,7 @@ public void persistSimpleA() { public void verifyChangeTracking() { persistSimpleA(); DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); UnitOfWork uow = session.acquireUnitOfWork(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java index 57c56762ef4..ea059245c4d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,7 +25,6 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.Assert; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -125,7 +125,7 @@ public void verifyConfig() throws Exception { @Test public void createSimpleA() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity(); simpleInstance.set("id", 1); @@ -139,13 +139,13 @@ public void createSimpleA() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); } @Test public void createSimpleB() { DynamicType simpleTypeB = dynamicHelper.getType("SimpleB"); - Assert.assertNotNull(simpleTypeB); + assertNotNull(simpleTypeB); DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity(); simpleInstance.set("id", 1); @@ -159,16 +159,16 @@ public void createSimpleB() { countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); int simpleCount = ((Number) session.executeQuery(countQuery)).intValue(); - Assert.assertEquals(1, simpleCount); + assertEquals(1, simpleCount); } @Test public void createSimpleAwithSimpleB() { DynamicType simpleTypeA = dynamicHelper.getType("SimpleA"); - Assert.assertNotNull(simpleTypeA); + assertNotNull(simpleTypeA); DynamicType simpleTypeB = dynamicHelper.getType("SimpleB"); - Assert.assertNotNull(simpleTypeB); - Assert.assertNotNull(session.getDescriptorForAlias("SimpleB")); + assertNotNull(simpleTypeB); + assertNotNull(session.getDescriptorForAlias("SimpleB")); DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity(); simpleInstanceB.set("id", 2); @@ -191,12 +191,12 @@ public void createSimpleAwithSimpleB() { ReportQuery countQuery = dynamicHelper.newReportQuery("SimpleB", new ExpressionBuilder()); countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); - Assert.assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue()); + assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue()); countQuery = dynamicHelper.newReportQuery("SimpleA", new ExpressionBuilder()); countQuery.addCount(); countQuery.setShouldReturnSingleValue(true); - Assert.assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue()); + assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue()); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierEqualsTest.java index 57933dfaf39..8eac3b0f0a1 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ public void setup() { Employee emp; emp = (Employee)getSomeEmployees().firstElement(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp = ?1"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e = ?1"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierNotEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierNotEqualsTest.java index 3644c805a66..34ac51c1738 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierNotEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/AbstractSchemaIdentifierNotEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,7 +24,7 @@ public void setup() { Vector employees = getSomeEmployees(); emp = (Employee)employees.firstElement(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp <> ?1"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e <> ?1"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BaseTestCase.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BaseTestCase.java index cfbffbe7660..32a00e05ff6 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BaseTestCase.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BaseTestCase.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ public void setup() { Vector employees = getSession().readAllObjects(Employee.class); setOriginalOject(employees); - setEjbqlString("SELECT OBJECT(emp) FROM Employee emp"); + setEjbqlString("SELECT OBJECT(e) FROM Employee e"); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorTest.java index c58568a56ef..b59df2805c2 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,7 +31,7 @@ public static BinaryOperatorTest getSimpleGreaterThanTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Greater Than test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.id > 12"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.id > 12"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -44,7 +45,7 @@ public static BinaryOperatorTest getSimpleGreaterThanEqualTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Greater Than Equal test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.id >= 12"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.id >= 12"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -58,7 +59,7 @@ public static BinaryOperatorTest getSimpleLessThanEqualTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Less Than Equal test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.id <= 1000000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.id <= 1000000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -72,7 +73,7 @@ public static BinaryOperatorTest getSimpleLessThanTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Less Than test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.id < 1000000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.id < 1000000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -86,7 +87,7 @@ public static BinaryOperatorTest getSimplePlusTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Plus test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary + 1000 <= 50000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.salary + 1000 <= 50000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -100,7 +101,7 @@ public static BinaryOperatorTest getSimplePlusTestWithBracketsBeforeComparison() BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Plus test with brackets before comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary + 1000) <= 50000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE (e.salary + 1000) <= 50000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -114,7 +115,7 @@ public static BinaryOperatorTest getSimplePlusTestWithBracketsAfterComparison() BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Plus test with brackets after comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE 50000 > (emp.salary + 1000)"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE 50000 > (e.salary + 1000)"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -128,7 +129,7 @@ public static BinaryOperatorTest getSimpleMinusTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Minus test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary - 1000 <= 50000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.salary - 1000 <= 50000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -142,7 +143,7 @@ public static BinaryOperatorTest getSimpleMinusTestWithBracketsBeforeComparison( BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Minus test with Brackets Before Comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary - 1000) <= 50000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE (e.salary - 1000) <= 50000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -156,7 +157,7 @@ public static BinaryOperatorTest getSimpleMinusTestWithBracketsAfterComparison() BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Minus test with Brackets After Comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE 50000 > (emp.salary - 1000)"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE 50000 > (e.salary - 1000)"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -170,7 +171,7 @@ public static BinaryOperatorTest getSimpleMultiplyTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Multiply test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary * 2 <= 100000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.salary * 2 <= 100000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -184,7 +185,7 @@ public static BinaryOperatorTest getSimpleMultiplyTestWithBracketsBeforeComparis BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Multiply test with brackets before comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary * 2) <= 100000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE (e.salary * 2) <= 100000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -198,7 +199,7 @@ public static BinaryOperatorTest getSimpleMultiplyTestWithBracketsAfterCompariso BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Multiply test with brackets after comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE 100000 > (emp.salary * 2)"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE 100000 > (e.salary * 2)"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -212,7 +213,7 @@ public static BinaryOperatorTest getSimpleDivideTest() { BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Divide test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary / 2 <= 20000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.salary / 2 <= 20000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -226,7 +227,7 @@ public static BinaryOperatorTest getSimpleDivideTestWithBracketsBeforeComparison BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Divide test with brackets before comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary / 2) <= 20000"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE (e.salary / 2) <= 20000"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); @@ -240,7 +241,7 @@ public static BinaryOperatorTest getSimpleDivideTestWithBracketsAfterComparison( BinaryOperatorTest theTest = new BinaryOperatorTest(); theTest.setName("Simple Divide test with brackets after comparison"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE 20000 > (emp.salary / 2)"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE 20000 > (e.salary / 2)"); theTest.setReferenceClass(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorWithParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorWithParameterTest.java index bd2c35ec31b..fceec4bb28f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorWithParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/BinaryOperatorWithParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -42,8 +43,8 @@ public static BinaryOperatorWithParameterTest getNumericParameterGreaterThanTest Expression whereClause = builder.get("id").greaterThan(builder.getParameter(parameterName)); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id > ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id > ?1 "; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -65,8 +66,8 @@ public static BinaryOperatorWithParameterTest getNumericParameterGreaterThanEqua Expression whereClause = builder.get("id").greaterThanEqual(builder.getParameter(parameterName)); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id >= ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id >= ?1 "; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -88,8 +89,8 @@ public static BinaryOperatorWithParameterTest getNumericParameterLessThanTest() Expression whereClause = builder.get("id").lessThan(builder.getParameter(parameterName)); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id < ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id < ?1 "; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -111,8 +112,8 @@ public static BinaryOperatorWithParameterTest getNumericParameterLessThanEqualTe Expression whereClause = builder.get("id").lessThanEqual(builder.getParameter(parameterName)); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id <= ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id <= ?1 "; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -134,7 +135,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterPlusTest() { Expression whereClause = ExpressionMath.add(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(50000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary + ?1 <= 50000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary + ?1 <= 50000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -159,7 +160,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterPlusTestWithBra Expression whereClause = ExpressionMath.add(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(50000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary + ?1) <= 50000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE (e.salary + ?1) <= 50000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -184,7 +185,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterPlusTestWithBra Expression whereClause = ExpressionBuilder.fromConstant(new Integer(50000), builder).greaterThan(ExpressionMath.add(builder.get("salary"), (builder.getParameter(parameterName)))); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE 50000 > (emp.salary + ?1)"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE 50000 > (e.salary + ?1)"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -209,7 +210,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMinusTest() { Expression whereClause = ExpressionMath.subtract(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(50000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary - ?1 <= 50000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary - ?1 <= 50000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -234,7 +235,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMinusTestWithBr Expression whereClause = ExpressionMath.subtract(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(50000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary - ?1) <= 50000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE (e.salary - ?1) <= 50000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -259,7 +260,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMinusTestWithBr Expression whereClause = ExpressionBuilder.fromConstant(new Integer(50000), builder).greaterThan(ExpressionMath.subtract(builder.get("salary"), (builder.getParameter(parameterName)))); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE 50000 > (emp.salary - ?1)"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE 50000 > (e.salary - ?1)"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -284,7 +285,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMultiplyTest() Expression whereClause = ExpressionMath.multiply(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(100000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary * ?1 <= 100000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary * ?1 <= 100000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -309,7 +310,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMultiplyTestWit Expression whereClause = ExpressionMath.multiply(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(100000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary * ?1) <= 100000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE (e.salary * ?1) <= 100000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -334,7 +335,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterMultiplyTestWit Expression whereClause = ExpressionBuilder.fromConstant(new Integer(100000), builder).greaterThan(ExpressionMath.multiply(builder.get("salary"), (builder.getParameter(parameterName)))); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE 100000 > (emp.salary * ?1)"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE 100000 > (e.salary * ?1)"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -359,7 +360,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterDivideTest() { Expression whereClause = ExpressionMath.divide(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(20000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary / ?1 <= 20000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary / ?1 <= 20000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -384,7 +385,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterDivideTestWithB Expression whereClause = ExpressionMath.divide(builder.get("salary"), (builder.getParameter(parameterName))).lessThanEqual(20000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary / ?1) <= 20000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE (e.salary / ?1) <= 20000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -409,7 +410,7 @@ public static BinaryOperatorWithParameterTest getNumericParameterDivideTestWithB Expression whereClause = ExpressionBuilder.fromConstant(new Integer(20000), builder).greaterThan(ExpressionMath.divide(builder.get("salary"), (builder.getParameter(parameterName)))); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE 20000 > (emp.salary / ?1)"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE 20000 > (e.salary / ?1)"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -436,7 +437,7 @@ public static BinaryOperatorWithParameterTest getNumericTwoParameterMultipleOper Expression whereClause = ExpressionMath.subtract(ExpressionMath.add(builder.get("salary"), 10000), ExpressionMath.multiply(ExpressionMath.divide(ExpressionBuilder.fromConstant(new Integer(10000), builder), builder.getParameter(parameterNameForDivide)), builder.getParameter(parameterNameForMultiply))).greaterThanEqual(50000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary + 10000 - 10000 / ?1 * ?2 >= 50000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary + 10000 - 10000 / ?1 * ?2 >= 50000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -465,7 +466,7 @@ public static BinaryOperatorWithParameterTest getNumericTwoParameterMultipleOper Expression whereClause = ExpressionMath.multiply(ExpressionMath.divide(ExpressionMath.subtract(ExpressionMath.add(builder.get("salary"), 10), 20), builder.getParameter(parameterNameForDivide)), builder.getParameter(parameterNameForMultiply)).greaterThanEqual(70000); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE (emp.salary + 10 - 20) / ?1 * ?2 >= 70000"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE (e.salary + 10 - 20) / ?1 * ?2 >= 70000"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); @@ -494,7 +495,7 @@ public static BinaryOperatorWithParameterTest getNumericTwoParameterMultipleOper Expression whereClause = builder.get("salary").greaterThan(ExpressionMath.subtract(ExpressionMath.add(ExpressionBuilder.fromConstant(new Integer(50000), builder), 10000), ExpressionMath.divide(ExpressionBuilder.fromConstant(new Integer(10000), builder), ExpressionMath.multiply(builder.getParameter(parameterNameForMultiply), builder.getParameter(parameterNameForDivide))))); theTest.setOriginalObjectExpression(whereClause); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary > (50000 + 10000 - 10000 / (?1 * ?2))"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.salary > (50000 + 10000 - 10000 / (?1 * ?2))"; theTest.setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ChangeJPQLStringAfterExecutionTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ChangeJPQLStringAfterExecutionTest.java index 1f2dfd20dcf..176009262bd 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ChangeJPQLStringAfterExecutionTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ChangeJPQLStringAfterExecutionTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,9 +36,9 @@ public void setup() { //Define the firstEJBQLString, which will NOT match the results expected, and the //secondEJBQLString which will match. - firstEJBQLString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = "; + firstEJBQLString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName = "; firstEJBQLString = firstEJBQLString + "\"WRONG\""; - secondEJBQLString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = "; + secondEJBQLString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName = "; secondEJBQLString = secondEJBQLString + "\"" + emp.getFirstName() + "\""; //start with the firstEJBQLString diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierEqualsTest.java index 55a47bf124e..5b5fc7803a8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,7 +24,7 @@ public void setup() { emp = (Employee)getSomeEmployees().firstElement(); PhoneNumber phoneNumber = (PhoneNumber)emp.getPhoneNumbers().elementAt(0); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, IN (emp.phoneNumbers) phone " + "WHERE phone = ?1"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN (e.phoneNumbers) phone " + "WHERE phone = ?1"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierNotEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierNotEqualsTest.java index 4462156429b..ec99331d471 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierNotEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/CollectionMemberIdentifierNotEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,7 +25,7 @@ public void setup() { emp = (Employee)employees.firstElement(); PhoneNumber phoneNumber = (PhoneNumber)emp.getPhoneNumbers().elementAt(0); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, IN (emp.phoneNumbers) phone " + "WHERE phone <> ?1"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN (e.phoneNumbers) phone " + "WHERE phone <> ?1"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexAbsTest.java index c6c1df970b0..2104c5f7e68 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,10 +27,10 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(ABS(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(ABS(e.salary) = "; ejbqlString = ejbqlString + emp1.getSalary() + ")"; - ejbqlString = ejbqlString + " OR (ABS(emp.salary) = "; + ejbqlString = ejbqlString + " OR (ABS(e.salary) = "; ejbqlString = ejbqlString + emp2.getSalary() + ")"; setEjbqlString(ejbqlString); Vector employeesUsed = new Vector(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInTest.java index d701a6ab6bc..323cc6803ea 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,7 +42,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id IN ("; ejbqlString = ejbqlString + emp1.getId().toString() + ", "; ejbqlString = ejbqlString + emp2.getId().toString() + ", "; ejbqlString = ejbqlString + emp3.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceTest.java index 0e6de8e4c02..e70b3bec7ea 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -21,7 +22,7 @@ in context of a subclass table. UsingEmployee demo, the following EJBQL is executed on the Project class: -"SELECT OBJECT(project) FROM Project project WHERE project.name = ?1"); +"SELECT OBJECT(p) FROM Project p WHERE p.name = ?1"); with the value "Swirly Dirly", which is the name of the LargeProject (a subclass of the Project class). The following Exception is thrown: @@ -78,7 +79,7 @@ public void setup() { } //Set criteria for EJBQL and call super-class method to construct the EJBQL query - String ejbql = "SELECT OBJECT(project) FROM ProjectBaseClass project WHERE project.name = \"" + projectName + "\""; + String ejbql = "SELECT OBJECT(pbc) FROM ProjectBaseClass pbc WHERE pbc.name = \"" + projectName + "\""; this.setEjbqlString(ejbql); this.setReferenceClass(LargeProject.class); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceUsingNamedQueryTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceUsingNamedQueryTest.java index a9a58939171..e544601a954 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceUsingNamedQueryTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexInheritanceUsingNamedQueryTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,7 +31,7 @@ in context of a subclass table. UsingEmployee demo, the following EJBQL is executed on the Project class: -"SELECT OBJECT(project) FROM Project project WHERE project.name = ?1"); +"SELECT OBJECT(p) FROM Project p WHERE p.name = ?1"); with the value "Swirly Dirly", which is the name of the LargeProject (a subclass of the Project class). The following Exception is thrown: @@ -104,7 +105,7 @@ public void setUpSessionWithNamedQuery() { //Named query must be built and registered with the session ReadObjectQuery query = new ReadObjectQuery(); - query.setEJBQLString("SELECT OBJECT(project) FROM ProjectBaseClass project WHERE project.name = ?1"); + query.setEJBQLString("SELECT OBJECT(pbc) FROM ProjectBaseClass pbc WHERE pbc.name = ?1"); query.setName(queryName); query.addArgument("1"); query.setReferenceClass(Project.class); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLengthTest.java index 37f07f547a6..15e5d62effb 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,11 +30,11 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(LENGTH(emp.firstName) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(LENGTH(e.firstName) = "; ejbqlString = ejbqlString + emp.getFirstName().length() + ")"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "(LENGTH(emp.lastName) = "; + ejbqlString = ejbqlString + "(LENGTH(e.lastName) = "; ejbqlString = ejbqlString + emp.getLastName().length() + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLikeTest.java index ea7c7ef6f93..43aa07bc303 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -40,7 +41,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNestedOneToManyUsingInClause.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNestedOneToManyUsingInClause.java index 7fb16141734..083765fe04a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNestedOneToManyUsingInClause.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNestedOneToManyUsingInClause.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,7 +37,7 @@ public void setup() { getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, " + "IN(emp.managedEmployees) mEmployees, IN(mEmployees.projects) projects " + "WHERE projects.name = 'Enterprise'"; + ejbqlString = "SELECT OBJECT(e) FROM Employee e, " + "IN(e.managedEmployees) mE, IN(mE.projects) p " + "WHERE p.name = 'Enterprise'"; setEjbqlString(ejbqlString); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotInTest.java index d1029e19095..7387d0fedff 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -44,7 +45,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id NOT IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id NOT IN ("; ejbqlString = ejbqlString + emp1.getId().toString() + ", "; ejbqlString = ejbqlString + emp2.getId().toString() + ", "; ejbqlString = ejbqlString + emp3.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotLikeTest.java index 6f7d3563df5..e06016b484e 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexNotLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -40,7 +41,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); //setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexParameterTest.java index 748353af21a..32e9d8d86a5 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,10 +47,10 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = ?1 "; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "emp.lastName = ?2"; + ejbqlString = ejbqlString + "e.lastName = ?2"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseAbsTest.java index fb06a5375a0..0bf1eca8527 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,12 +27,12 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp1.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; ejbqlString = ejbqlString + " OR "; ejbqlString = ejbqlString + emp2.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; setEjbqlString(ejbqlString); Vector employeesUsed = new Vector(); employeesUsed.add(emp1); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseLengthTest.java index a302326db6a..d2e21b46b8e 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,12 +30,12 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getFirstName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.firstName)"; + ejbqlString = ejbqlString + " = LENGTH(e.firstName)"; ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp.getLastName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.lastName)"; + ejbqlString = ejbqlString + " = LENGTH(e.lastName)"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseParameterTest.java index e1cd3e4c8a2..c32ab463a9d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,10 +47,10 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "?1 = emp.firstName"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "?1 = e.firstName"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "?2 = emp.lastName"; + ejbqlString = ejbqlString + "?2 = e.lastName"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSqrtTest.java index 8ce716ec75b..3b103431ba1 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,12 +27,12 @@ public void setup() { double salarySquareRoot1 = Math.sqrt((new Double(emp1.getSalary()).doubleValue())); double salarySquareRoot2 = Math.sqrt((new Double(emp2.getSalary()).doubleValue())); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + salarySquareRoot1; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; ejbqlString = ejbqlString + " OR "; ejbqlString = ejbqlString + salarySquareRoot2; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(getTestEmployees()); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSubstringTest.java index be243049c55..055094e6263 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexReverseSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,12 +30,12 @@ public void setup() { firstNamePart = emp.getFirstName().substring(0, 2); lastNamePart = emp.getLastName().substring(0, 1); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + firstNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.firstName, 1, 2)";//changed from 0,2 to 1, 2(ZYP) + ejbqlString = ejbqlString + " = SUBSTRING(e.firstName, 1, 2)";//changed from 0,2 to 1, 2(ZYP) ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + "\"" + lastNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.lastName, 1, 1)";//changed from 0,1 to 1, 1(ZYP) + ejbqlString = ejbqlString + " = SUBSTRING(e.lastName, 1, 1)";//changed from 0,1 to 1, 1(ZYP) setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSqrtTest.java index d411cb37bca..1f4ba029425 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,11 +27,11 @@ public void setup() { double salarySquareRoot1 = Math.sqrt((new Double(emp1.getSalary()).doubleValue())); double salarySquareRoot2 = Math.sqrt((new Double(emp2.getSalary()).doubleValue())); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(SQRT(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot1 + ")"; ejbqlString = ejbqlString + " OR "; - ejbqlString = ejbqlString + "(SQRT(emp.salary) = "; + ejbqlString = ejbqlString + "(SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot2 + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringInTest.java index c32d816edbf..57bb48130ce 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,7 +42,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName IN ("; ejbqlString = ejbqlString + "\"" + emp1.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp2.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp3.getFirstName() + "\""; diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringNotInTest.java index 6a767f3dc5c..767af656321 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexStringNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -43,7 +44,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT IN ("; ejbqlString = ejbqlString + "\"" + emp1.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp2.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp3.getFirstName() + "\""; diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSubstringTest.java index 66c6fcb47be..61379ce924f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ComplexSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,11 +30,11 @@ public void setup() { firstNamePart = emp.getFirstName().substring(0, 2); lastNamePart = emp.getLastName().substring(0, 1); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(SUBSTRING(emp.firstName, 1, 2) = ";//changed from 0, 2 to 1, 2(ZYP) + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(SUBSTRING(e.firstName, 1, 2) = ";//changed from 0, 2 to 1, 2(ZYP) ejbqlString = ejbqlString + "\"" + firstNamePart + "\")"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "(SUBSTRING(emp.lastName, 1, 1) = ";//changed from 0, 1 to 1, 1(ZYP) + ejbqlString = ejbqlString + "(SUBSTRING(e.lastName, 1, 1) = ";//changed from 0, 1 to 1, 1(ZYP) ejbqlString = ejbqlString + "\"" + lastNamePart + "\")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ConformResultsInUnitOfWorkTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ConformResultsInUnitOfWorkTest.java index 29e51cd46ed..a4a3877711a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ConformResultsInUnitOfWorkTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ConformResultsInUnitOfWorkTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -33,7 +34,7 @@ public void test() throws Exception { ReadObjectQuery readObjectQuery = new ReadObjectQuery(); readObjectQuery.setReferenceClass(Employee.class); - readObjectQuery.setEJBQLString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = ?1"); + readObjectQuery.setEJBQLString("SELECT OBJECT(e) FROM Employee e WHERE e.id = ?1"); readObjectQuery.conformResultsInUnitOfWork(); readObjectQuery.addArgument("1", BigDecimal.class); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/IdentifierTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/IdentifierTest.java index 4cd4852139c..0b835930153 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/IdentifierTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/IdentifierTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,7 +24,7 @@ public class IdentifierTest extends JPQLTestCase { public static IdentifierTest underscoreIdentTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Underscore identifier test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e"); return theTest; } @@ -31,7 +32,7 @@ public static IdentifierTest underscoreIdentTest() { public static IdentifierTest dollarSignIdentTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Dollar sign identifier test"); - theTest.setEjbqlString("SELECT OBJECT($emp) FROM Employee $emp"); + theTest.setEjbqlString("SELECT OBJECT($e) FROM Employee $e"); return theTest; } @@ -39,7 +40,7 @@ public static IdentifierTest dollarSignIdentTest() { public static IdentifierTest underscoreSchemaNameTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Underscore Schema name test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM _Employee emp"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM _Employee e"); return theTest; } @@ -47,7 +48,7 @@ public static IdentifierTest underscoreSchemaNameTest() { public static IdentifierTest dollarSignSchemaNameTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Dollar sign Schema name test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM $Employee emp"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM $Employee e"); return theTest; } @@ -55,7 +56,7 @@ public static IdentifierTest dollarSignSchemaNameTest() { public static IdentifierTest numericIdentTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Numeric Identifier test"); - theTest.setEjbqlString("SELECT OBJECT(emp1) FROM Employee emp1"); + theTest.setEjbqlString("SELECT OBJECT(e1) FROM Employee e1"); return theTest; } @@ -63,7 +64,7 @@ public static IdentifierTest numericIdentTest() { public static JPQLExceptionTest badIdentifierTest1() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.setName("Bad Identifier test1"); - theTest.setEjbqlString("SELECT OBJECT(+emp1) FROM Employee +emp1"); + theTest.setEjbqlString("SELECT OBJECT(+e1) FROM Employee +e1"); theTest.expectedException = JPQLException.syntaxErrorAt(null, 0, 0, null, null); return theTest; @@ -72,7 +73,7 @@ public static JPQLExceptionTest badIdentifierTest1() { public static JPQLExceptionTest badIdentifierTest2() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.setName("Bad Identifier test2"); - theTest.setEjbqlString("SELECT OBJECT(emp 1) FROM Employee emp 1"); + theTest.setEjbqlString("SELECT OBJECT(e 1) FROM Employee e 1"); theTest.expectedException = JPQLException.syntaxErrorAt(null, 0, 0, null, null); return theTest; @@ -81,7 +82,7 @@ public static JPQLExceptionTest badIdentifierTest2() { public static IdentifierTest complexIdentTest() { IdentifierTest theTest = new IdentifierTest(); theTest.setName("Complex Identifier test"); - theTest.setEjbqlString("SELECT OBJECT(_$emp1) FROM Employee _$emp1"); + theTest.setEjbqlString("SELECT OBJECT(_$e1) FROM Employee _$e1"); return theTest; } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java index 2e4f18787d2..3e1055149c1 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public class JPQLExceptionTest extends JPQLTestCase { public static JPQLExceptionTest recognitionExceptionTest() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.syntaxErrorAt(null, 0, 0, null, null); - theTest.setEjbqlString("SELECT OBJECT(emp) FROW Employee emp"); + theTest.setEjbqlString("SELECT OBJECT(e) FROW Employee e"); theTest.setName("Recognition Exception Test"); return theTest; } @@ -45,7 +46,7 @@ public static JPQLExceptionTest missingSelectExceptionTest() { public static JPQLExceptionTest malformedEjbqlExceptionTest1() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.unexpectedToken(null, 0, 0, null, null); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName == \"Fred\""); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.firstName == \"Fred\""); theTest.setName("Malformed EJBQL Exception Test1"); return theTest; } @@ -53,7 +54,7 @@ public static JPQLExceptionTest malformedEjbqlExceptionTest1() { public static JPQLExceptionTest malformedEjbqlExceptionTest2() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.unexpectedEOF(null, 0, 0, null); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = \"Fred\" AND 1"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = \"Fred\" AND 1"); theTest.setName("Malformed EJBQL Exception Test2"); return theTest; } @@ -61,7 +62,7 @@ public static JPQLExceptionTest malformedEjbqlExceptionTest2() { public static JPQLExceptionTest malformedEjbqlExceptionTest3() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.unexpectedEOF(null, 0, 0, null); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = \"Fred\" OR \"Freda\""); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = \"Fred\" OR \"Freda\""); theTest.setName("Malformed EJBQL Exception Test3"); return theTest; } @@ -69,7 +70,7 @@ public static JPQLExceptionTest malformedEjbqlExceptionTest3() { public static JPQLExceptionTest malformedEjbqlExceptionTest4() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.unexpectedToken(null, 0, 0, null, null); - theTest.setEjbqlString("SLEECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = \"Fred\" OR \"Freda\""); + theTest.setEjbqlString("SLEECT OBJECT(e) FROM Employee e WHERE e.firstName = \"Fred\" OR \"Freda\""); theTest.setName("Malformed EJBQL Exception Test4"); return theTest; } @@ -77,7 +78,7 @@ public static JPQLExceptionTest malformedEjbqlExceptionTest4() { public static JPQLExceptionTest badAliasExceptionTest() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.aliasResolutionException(null, 0, 0, null); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee employee WHERE emp.firstName = \"Fred\""); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee employee WHERE e.firstName = \"Fred\""); theTest.setName("Bad Alias Exception Test 2"); return theTest; } @@ -115,7 +116,7 @@ public static JPQLExceptionTest aliasResolutionException() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.aliasResolutionException(null, 0, 0, null); theTest.setName("Bad Alias Exception test 1"); - theTest.setEjbqlString("SELECT OBJECT(nullRoot) FROM Employee emp WHERE emp.firstName = \"Fred\""); + theTest.setEjbqlString("SELECT OBJECT(nullRoot) FROM Employee e WHERE e.firstName = \"Fred\""); return theTest; } @@ -133,7 +134,7 @@ public static JPQLExceptionTest expressionNotSupportedTest() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.expressionNotSupported(null, null); theTest.setName("Expression Not Supported Exception test"); - theTest.setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.phoneNumbers IS EMPTY"); + theTest.setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS EMPTY"); return theTest; } @@ -142,7 +143,7 @@ public static JPQLExceptionTest memberOfNotSupportedTest() { JPQLExceptionTest theTest = new JPQLExceptionTest(); theTest.expectedException = JPQLException.expressionNotSupported(null, null); theTest.setName("MEMBER OF Not Supported Exception test"); - theTest.setEjbqlString("SELECT OBJECT(proj) FROM Employee emp, Project proj " + " WHERE (proj.teamLeader MEMBER OF emp.manager.managedEmployees) " + "AND (emp.lastName = \"Chan\")"); + theTest.setEjbqlString("SELECT OBJECT(p) FROM Employee e, Project p " + " WHERE (p.teamLeader MEMBER OF e.manager.managedEmployees) " + "AND (e.lastName = \"Chan\")"); return theTest; } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleSelectTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleSelectTestSuite.java index 0581a3f9c3f..b82f18dca33 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleSelectTestSuite.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleSelectTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -84,8 +85,8 @@ public void addTests() { //addTest(new SimpleSelectPhoneNumberNumberWithEmployeeWithExplicitJoin()); // addTest(new SimpleSelectPhoneNumberNumberWithEmployeeWithFirstNameFirst()); //SELECT from CALLS - addTest(new ReadObjectCallTest(Employee.class, new JPQLCall("SELECT OBJECT(emp) FROM Employee emp"))); - addTest(new ReadAllCallTest(Employee.class, 12, new JPQLCall("SELECT OBJECT(emp) FROM Employee emp"))); + addTest(new ReadObjectCallTest(Employee.class, new JPQLCall("SELECT OBJECT(e) FROM Employee e"))); + addTest(new ReadAllCallTest(Employee.class, 12, new JPQLCall("SELECT OBJECT(e) FROM Employee e"))); addTest(new SelectSimpleMemberOfTest()); addTest(new SelectSimpleMemberOfWithParameterTest()); addTest(new SelectSimpleNotMemberOfWithParameterTest()); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleTestSuite.java index ab97dfbc02a..94fe038b916 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleTestSuite.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/JPQLSimpleTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -150,7 +151,7 @@ public TestCase buildMaxRowsTest() { return new TestCase() { public void test() { ReadAllQuery query = new ReadAllQuery(Employee.class); - query.setEJBQLString("Select Object(Emp) from Employee Emp"); + query.setEJBQLString("Select Object(e) from Employee e"); List results = (List) getSession().executeQuery(query); if (results.size() != 12) { throwError("Incorrect number of employees:12->" + results.size()); @@ -161,7 +162,7 @@ public void test() { throwError("Incorrect number of employees:12->" + results.size()); } query = new ReadAllQuery(Employee.class); - query.setEJBQLString("Select Object(Emp) from Employee Emp"); + query.setEJBQLString("Select Object(e) from Employee e"); query.setMaxRows(5); results = (List) getSession().executeQuery(query); if (results.size() != 5) { diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ModTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ModTest.java index 199d615b045..2e15842a9fa 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ModTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ModTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -33,7 +34,7 @@ private static ModTest getNewTestCaseNamed(String name, String ejbql, Class refe } public static ModTest getSimpleModTest() { - String ejbql = "SELECT OBJECT(emp) FROM Employee emp WHERE MOD(emp.salary, 2) > 0"; + String ejbql = "SELECT OBJECT(e) FROM Employee e WHERE MOD(e.salary, 2) > 0"; ModTest test = getNewTestCaseNamed("Mod Test", ejbql, Employee.class); ExpressionBuilder employee = new ExpressionBuilder(); @@ -48,7 +49,7 @@ public static ModTest getComplexModTest() { ModTest test = getSimpleModTest(); test.setName("Complex " + test.getName()); - test.setEjbqlString(test.getEjbqlString() + " AND emp.firstName <> \"XCV\""); + test.setEjbqlString(test.getEjbqlString() + " AND e.firstName <> \"XCV\""); return test; } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/OrderByTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/OrderByTest.java index 959ed866989..ef8a9b2fabe 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/OrderByTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/OrderByTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,9 +37,9 @@ public static OrderByTest getSimpleOrderByTestAscDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName ASC"; + ejbqlString = ejbqlString + "ORDER BY e.lastName ASC"; test.setEjbqlString(ejbqlString); @@ -58,9 +59,9 @@ public static OrderByTest getSimpleOrderByTestDescDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName DESC"; + ejbqlString = ejbqlString + "ORDER BY e.lastName DESC"; test.setEjbqlString(ejbqlString); @@ -81,9 +82,9 @@ public static OrderByTest getSimpleOrderByTestNoDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName"; + ejbqlString = ejbqlString + "ORDER BY e.lastName"; test.setEjbqlString(ejbqlString); @@ -104,9 +105,9 @@ public static OrderByTest getComplexOrderByNoDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName, emp.firstName"; + ejbqlString = ejbqlString + "ORDER BY e.lastName, e.firstName"; test.setEjbqlString(ejbqlString); @@ -127,9 +128,9 @@ public static OrderByTest getComplexOrderByAscDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName ASC, emp.firstName ASC"; + ejbqlString = ejbqlString + "ORDER BY e.lastName ASC, e.firstName ASC"; test.setEjbqlString(ejbqlString); @@ -150,9 +151,9 @@ public static OrderByTest getComplexOrderByDescDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName DESC, emp.firstName DESC"; + ejbqlString = ejbqlString + "ORDER BY e.lastName DESC, e.firstName DESC"; test.setEjbqlString(ejbqlString); @@ -173,9 +174,9 @@ public static OrderByTest getComplexOrderByMixedDirection() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName <> "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName <> "; ejbqlString = ejbqlString + "\"XXX\" "; - ejbqlString = ejbqlString + "ORDER BY emp.lastName ASC, emp.firstName DESC"; + ejbqlString = ejbqlString + "ORDER BY e.lastName ASC, e.firstName DESC"; test.setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParameterNameMismatchTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParameterNameMismatchTest.java index 9ad2ffdeb64..ff9be0ab6e1 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParameterNameMismatchTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParameterNameMismatchTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,7 @@ public class ParameterNameMismatchTest extends JPQLTestCase { public void setup() { // ?2 is used intentionally, with only "1" added to the query. - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp where emp.firstName = ?2"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e where e.firstName = ?2"; setEjbqlString(ejbqlString); Vector myArgumentNames = new Vector(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParseOnceTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParseOnceTest.java index 3e7d4218d3c..bf4e9d2dc6a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParseOnceTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/ParseOnceTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,7 @@ public class ParseOnceTest extends JPQLTestCase { public void setup() { Vector employeesUsed = getSomeEmployees(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e"; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexAbsTest.java index 610056f7aee..4c1b5d9ec5f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,10 +27,10 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(ABS(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(ABS(e.salary) = "; ejbqlString = ejbqlString + emp1.getSalary() + ")"; - ejbqlString = ejbqlString + " OR (ABS(emp.salary) = "; + ejbqlString = ejbqlString + " OR (ABS(e.salary) = "; ejbqlString = ejbqlString + emp2.getSalary() + ")"; setEjbqlString(ejbqlString); Vector employeesUsed = new Vector(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexInTest.java index d3260a0bbba..ae368a3cefe 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,7 +28,7 @@ public void setup() { emp3 = (Employee)getSomeEmployees().elementAt(2); // String ejbqlString = "FROM Employee emp WHERE emp.id IN (" + emp.getId().toString() + ")"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id IN ("; ejbqlString = ejbqlString + emp1.getId().toString() + ", "; ejbqlString = ejbqlString + emp2.getId().toString() + ", "; ejbqlString = ejbqlString + emp3.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLengthTest.java index 53bcdde4f1c..f15d77c1265 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,11 +30,11 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(LENGTH(emp.firstName) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(LENGTH(e.firstName) = "; ejbqlString = ejbqlString + emp.getFirstName().length() + ")"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "(LENGTH(emp.lastName) = "; + ejbqlString = ejbqlString + "(LENGTH(e.lastName) = "; ejbqlString = ejbqlString + emp.getLastName().length() + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLikeTest.java index f5b6664ed94..233e2f59b47 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -28,7 +29,7 @@ public void setup() { partialFirstName.append("_"); partialFirstName.append(firstName.substring(2, 4)); partialFirstName.append( "%"); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName LIKE \"" + partialFirstName.toString() + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName LIKE \"" + partialFirstName.toString() + "\""; setEjbqlString(ejbqlString); setOriginalOject(emp); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotInTest.java index 984ccb789f0..c1331690c8a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -44,7 +45,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id NOT IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id NOT IN ("; ejbqlString = ejbqlString + emp1.getId().toString() + ", "; ejbqlString = ejbqlString + emp2.getId().toString() + ", "; ejbqlString = ejbqlString + emp3.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotLikeTest.java index b92e9833a08..d6492529518 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexNotLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,7 +42,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT LIKE \"" + partialFirstName.toString() + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT LIKE \"" + partialFirstName.toString() + "\""; setEjbqlString(ejbqlString); //setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexParameterTest.java index 4c0a15572d2..33a28ac44c2 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,10 +47,10 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = ?1 "; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "emp.lastName = ?2"; + ejbqlString = ejbqlString + "e.lastName = ?2"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseAbsTest.java index e58a397de49..13b1eb7ff16 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,12 +27,12 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp1.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; ejbqlString = ejbqlString + " OR "; ejbqlString = ejbqlString + emp2.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; setEjbqlString(ejbqlString); Vector employeesUsed = new Vector(); employeesUsed.add(emp1); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseLengthTest.java index 9060638fe33..da500ffc7fb 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,12 +30,12 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getFirstName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.firstName)"; + ejbqlString = ejbqlString + " = LENGTH(e.firstName)"; ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp.getLastName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.lastName)"; + ejbqlString = ejbqlString + " = LENGTH(e.lastName)"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseParameterTest.java index e2bc82f482c..817732ca7a2 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,10 +47,10 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "?1 = emp.firstName"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "?1 = e.firstName"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "?2 = emp.lastName"; + ejbqlString = ejbqlString + "?2 = e.lastName"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSqrtTest.java index f5e7b724a82..4a8c12a1e26 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,12 +27,12 @@ public void setup() { double salarySquareRoot1 = Math.sqrt((new Double(emp1.getSalary()).doubleValue())); double salarySquareRoot2 = Math.sqrt((new Double(emp2.getSalary()).doubleValue())); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + salarySquareRoot1; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; ejbqlString = ejbqlString + " OR "; ejbqlString = ejbqlString + salarySquareRoot2; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(getTestEmployees()); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSubstringTest.java index d2ff82f4c52..7e13201e6c5 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexReverseSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,12 +31,12 @@ public void setup() { firstNamePart = emp.getFirstName().substring(0, 2); lastNamePart = emp.getLastName().substring(0, 1); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + firstNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.firstName, 1, 2)";//changed from 0, 2 to 1, 2(ZYP) + ejbqlString = ejbqlString + " = SUBSTRING(e.firstName, 1, 2)";//changed from 0, 2 to 1, 2(ZYP) ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + "\"" + lastNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.lastName, 1, 1)";//changed from 0, 1 to 1, 1(ZYP) + ejbqlString = ejbqlString + " = SUBSTRING(e.lastName, 1, 1)";//changed from 0, 1 to 1, 1(ZYP) setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSqrtTest.java index 563fccef38d..75133584284 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,11 +27,11 @@ public void setup() { double salarySquareRoot1 = Math.sqrt((new Double(emp1.getSalary()).doubleValue())); double salarySquareRoot2 = Math.sqrt((new Double(emp2.getSalary()).doubleValue())); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(SQRT(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot1 + ")"; ejbqlString = ejbqlString + " OR "; - ejbqlString = ejbqlString + "(SQRT(emp.salary) = "; + ejbqlString = ejbqlString + "(SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot2 + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringInTest.java index ff4f8e6241b..eff39049c8b 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,7 @@ public void setup() { emp2 = (Employee)getSomeEmployees().elementAt(1); emp3 = (Employee)getSomeEmployees().elementAt(2); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName IN ("; ejbqlString = ejbqlString + "\"" + emp1.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp2.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp3.getFirstName() + "\""; diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringNotInTest.java index 1ae5567cc57..0c9095de9f0 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexStringNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -43,7 +44,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT IN ("; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT IN ("; ejbqlString = ejbqlString + "\"" + emp1.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp2.getFirstName() + "\"" + ", "; ejbqlString = ejbqlString + "\"" + emp3.getFirstName() + "\""; diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSubstringTest.java index d36f065a3dd..6dadc057680 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectComplexSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,11 +30,11 @@ public void setup() { firstNamePart = emp.getFirstName().substring(0, 2); lastNamePart = emp.getLastName().substring(0, 1); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "(SUBSTRING(emp.firstName, 1, 2) = ";//changed from 0, 2 to 1, 2(ZYP) + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "(SUBSTRING(e.firstName, 1, 2) = ";//changed from 0, 2 to 1, 2(ZYP) ejbqlString = ejbqlString + "\"" + firstNamePart + "\")"; ejbqlString = ejbqlString + " AND "; - ejbqlString = ejbqlString + "(SUBSTRING(emp.lastName, 1, 1) = ";//changed from 0, 1 to 1, 1(ZYP) + ejbqlString = ejbqlString + "(SUBSTRING(e.lastName, 1, 1) = ";//changed from 0, 1 to 1, 1(ZYP) ejbqlString = ejbqlString + "\"" + lastNamePart + "\")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleAbsTest.java index 9d696be8bc2..dcd275c8c5a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,8 +23,8 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "ABS(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "ABS(e.salary) = "; ejbqlString = ejbqlString + emp.getSalary(); setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenAndTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenAndTest.java index 5239ffa7489..c00c06dda99 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenAndTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenAndTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,7 +36,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); setOriginalOject(getSession().executeQuery(raq)); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id BETWEEN " + emp1 + " AND " + emp2.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id BETWEEN " + emp1 + " AND " + emp2.id; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenTest.java index a8d184d2c28..5c220398662 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,8 +37,8 @@ public void setup() { employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id BETWEEN "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id BETWEEN "; ejbqlString = ejbqlString + empid1.toString(); ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp2.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenWithParametersTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenWithParametersTest.java index d73c0d358b8..09070286ea9 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenWithParametersTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBetweenWithParametersTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,8 +37,8 @@ public void setup() { employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id BETWEEN ?1 AND ?2"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id BETWEEN ?1 AND ?2"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBooleanTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBooleanTest.java index 0839281b14e..f332cfe083c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBooleanTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleBooleanTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,8 +27,8 @@ public class SelectSimpleBooleanTest extends JPQLTestCase { public static SelectSimpleBooleanTest getSimpleTrueTest() { SelectSimpleBooleanTest theTest = new SelectSimpleBooleanTest(); - String ejbqlString = "SELECT OBJECT(ibmpc) FROM IBMPC ibmpc WHERE "; - ejbqlString = ejbqlString + "ibmpc.isClone = true"; + String ejbqlString = "SELECT OBJECT(i) FROM IBMPC i WHERE "; + ejbqlString = ejbqlString + "i.isClone = true"; theTest.setEjbqlString(ejbqlString); ExpressionBuilder builder = new ExpressionBuilder(); @@ -43,8 +44,8 @@ public static SelectSimpleBooleanTest getSimpleTrueTest() { public static SelectSimpleBooleanTest getSimpleFalseTest() { SelectSimpleBooleanTest theTest = new SelectSimpleBooleanTest(); - String ejbqlString = "SELECT OBJECT(ibmpc) FROM IBMPC ibmpc WHERE "; - ejbqlString = ejbqlString + "ibmpc.isClone = false"; + String ejbqlString = "SELECT OBJECT(i) FROM IBMPC i WHERE "; + ejbqlString = ejbqlString + "i.isClone = false"; theTest.setEjbqlString(ejbqlString); ExpressionBuilder builder = new ExpressionBuilder(); @@ -60,8 +61,8 @@ public static SelectSimpleBooleanTest getSimpleFalseTest() { public static SelectSimpleBooleanTest getSimpleNotEqualsTrueTest() { SelectSimpleBooleanTest theTest = new SelectSimpleBooleanTest(); - String ejbqlString = "SELECT OBJECT(ibmpc) FROM IBMPC ibmpc WHERE "; - ejbqlString = ejbqlString + "ibmpc.isClone <> true"; + String ejbqlString = "SELECT OBJECT(i) FROM IBMPC i WHERE "; + ejbqlString = ejbqlString + "i.isClone <> true"; theTest.setEjbqlString(ejbqlString); ExpressionBuilder builder = new ExpressionBuilder(); @@ -77,8 +78,8 @@ public static SelectSimpleBooleanTest getSimpleNotEqualsTrueTest() { public static SelectSimpleBooleanTest getSimpleNotEqualsFalseTest() { SelectSimpleBooleanTest theTest = new SelectSimpleBooleanTest(); - String ejbqlString = "SELECT OBJECT(ibmpc) FROM IBMPC ibmpc WHERE "; - ejbqlString = ejbqlString + "ibmpc.isClone <> false"; + String ejbqlString = "SELECT OBJECT(i) FROM IBMPC i WHERE "; + ejbqlString = ejbqlString + "i.isClone <> false"; theTest.setEjbqlString(ejbqlString); ExpressionBuilder builder = new ExpressionBuilder(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleConcatTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleConcatTest.java index 31758273175..a7e2cdb5bb9 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleConcatTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleConcatTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,8 +30,8 @@ public void setup() { partOne = emp.getFirstName().substring(0, 2); partTwo = emp.getFirstName().substring(2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = "; ejbqlString = ejbqlString + "CONCAT(\""; ejbqlString = ejbqlString + partOne; ejbqlString = ejbqlString + "\", \""; diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleDoubleOrTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleDoubleOrTest.java index bc2e159ba6a..e54a852e431 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleDoubleOrTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleDoubleOrTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,7 +36,7 @@ public void setup() { employeesUsed.add(emp3); //String partialFirstName = emp.getFirstName().substring(0, 3) + "%"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = " + emp1.id + " OR emp.id = " + emp2.id + " OR emp.id = " + emp3.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id = " + emp1.id + " OR e.id = " + emp2.id + " OR e.id = " + emp3.id; //testEJBQL("FROM EmployeeBean employee WHERE employee.id = 456 OR employee.id = 756 ", false); setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsBracketsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsBracketsTest.java index ee399a0cd5a..5d784b51e21 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsBracketsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsBracketsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -25,8 +26,8 @@ public void setup() { Employee emp = (Employee)employees.firstElement(); setOriginalOject(emp); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "( emp.firstName = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "( e.firstName = "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsMultipleDots.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsMultipleDots.java index aa1a9be5894..a1f795f25a5 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsMultipleDots.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsMultipleDots.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -31,7 +32,7 @@ public void setup() { //String ejbqlString = "FROM Employee emp WHERE (emp.address.city = " + // emp1.getAddress().getCity() + ")"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.address.city = " + "\"" + emp1.getAddress().getCity() + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.address.city = " + "\"" + emp1.getAddress().getCity() + "\""; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsTest.java index 54b54193e34..d26756e34d8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -25,8 +26,8 @@ public void setup() { Employee emp = (Employee)employees.firstElement(); setOriginalOject(emp); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsWithAs.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsWithAs.java index 2c5d824b35f..77726558dba 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsWithAs.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleEqualsWithAs.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { Vector employeesUsed = new Vector(); employeesUsed.add(emp1); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee AS emp WHERE emp.id = " + emp1.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee AS e WHERE e.id = " + emp1.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleFromFailed.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleFromFailed.java index ae26ccb8a40..bcf8819d779 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleFromFailed.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleFromFailed.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ class SelectSimpleFromFailed extends JPQLExceptionTest { public void setup() { this.expectedException = JPQLException.syntaxErrorAt(null, 0, 0, null, null); - String ejbqlString = "SELECT OBJECT(emp) Frow AccountBean account"; + String ejbqlString = "SELECT OBJECT(e) Frow AccountBean account"; setEjbqlString(ejbqlString); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInClauseInFromEmployeeManagerAndPhoneNumbers.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInClauseInFromEmployeeManagerAndPhoneNumbers.java index a812890bcef..522ed185d26 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInClauseInFromEmployeeManagerAndPhoneNumbers.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInClauseInFromEmployeeManagerAndPhoneNumbers.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,7 +37,7 @@ public void setup() { Vector employees; employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(employee) FROM Employee employee, IN (employee.manager.phoneNumbers) phone " + "WHERE phone.areaCode = \"613\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN (e.manager.phoneNumbers) phone " + "WHERE phone.areaCode = \"613\""; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInOneDotTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInOneDotTest.java index bab500a0ceb..a3617c661d9 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInOneDotTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInOneDotTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ public void setup() { emp = (Employee)getSomeEmployees().firstElement(); PhoneNumber empPhoneNumbers = (PhoneNumber)emp.getPhoneNumbers().elementAt(0); - String ejbqlString = "SelecT OBJECT(emp) from Employee emp, in (emp.phoneNumbers) phone " + "Where phone.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; + String ejbqlString = "SelecT OBJECT(e) from Employee e, in (e.phoneNumbers) phone " + "Where phone.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInTest.java index c3c80311dbe..43dd77b9fb8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -21,7 +22,7 @@ public void setup() { Employee emp; emp = (Employee)getSomeEmployees().firstElement(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id IN (" + emp.getId().toString() + ")"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id IN (" + emp.getId().toString() + ")"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLengthTest.java index 7ea6515d84c..093ca6af70f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,8 +27,8 @@ public void setup() { Employee emp = (Employee)getSomeEmployees().firstElement(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "LENGTH ( emp.firstName ) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "LENGTH ( e.firstName ) = "; ejbqlString = ejbqlString + emp.getFirstName().length(); setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeEscapeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeEscapeTest.java index 5ca24777da8..7b2c94f445c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeEscapeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeEscapeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,8 +28,8 @@ public void setup() { Employee emp = getEmployeeWithRequiredNameLength(MIN_FIRSTNAME_LENGTH, getName()); String partialFirstName = emp.getFirstName().substring(0, 3) + "%"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp "; - ejbqlString = ejbqlString + "WHERE emp.firstName LIKE '" + partialFirstName + "' "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e "; + ejbqlString = ejbqlString + "WHERE e.firstName LIKE '" + partialFirstName + "' "; ejbqlString = ejbqlString + "ESCAPE '/'"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeTest.java index cfe0d9d6415..03c9c2b28c3 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -25,7 +26,7 @@ public void setup() { String partialFirstName; partialFirstName = emp.getFirstName().substring(0, 3) + "%"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfTest.java index 4c66bd64e77..4fd9399af10 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -20,8 +21,8 @@ public SelectSimpleMemberOfTest() { public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(proj) FROM Employee emp, Project proj "; - ejbqlString = ejbqlString + "WHERE proj.teamLeader NOT MEMBER OF emp.manager.managedEmployees"; + ejbqlString = "SELECT OBJECT(p) FROM Employee e, Project p "; + ejbqlString = ejbqlString + "WHERE p.teamLeader NOT MEMBER OF e.manager.managedEmployees"; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfWithParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfWithParameterTest.java index 9a55c0f1c1a..56336eac9c9 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfWithParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleMemberOfWithParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { phone.setNumber("1234567"); phone.setOwner(employee); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp " + "WHERE ?1 MEMBER OF emp.phoneNumbers"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e " + "WHERE ?1 MEMBER OF e.phoneNumbers"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotBetweenTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotBetweenTest.java index 8166944735b..0e460dac158 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotBetweenTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotBetweenTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,8 +36,8 @@ public void setup() { employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id NOT BETWEEN "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id NOT BETWEEN "; ejbqlString = ejbqlString + emp1.getId().toString(); ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp2.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotEqualsVariablesIngeter.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotEqualsVariablesIngeter.java index 925ff3af58e..cae5b7c84a8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotEqualsVariablesIngeter.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotEqualsVariablesIngeter.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,7 @@ public void setup() { emp1 = (Employee)getSomeEmployees().firstElement(); employeesUsed.remove(emp1); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id <> " + emp1.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id <> " + emp1.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); //setOriginalOject(emp1); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotInTest.java index 680796ee068..ce4eb2a38de 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); ////////// - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id NOT IN (" + emp.getId().toString() + ")"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id NOT IN (" + emp.getId().toString() + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotLikeTest.java index 8aa66663f6d..84787e6c011 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotMemberOfWithParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotMemberOfWithParameterTest.java index 16c6b85b439..7df0782088e 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotMemberOfWithParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNotMemberOfWithParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { phone.setNumber("1234567"); phone.setOwner(employee); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp " + "WHERE ?1 NOT MEMBER OF emp.phoneNumbers"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e " + "WHERE ?1 NOT MEMBER OF e.phoneNumbers"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNullTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNullTest.java index 5a7e1a277a3..acbce75725a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNullTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleNullTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,7 +28,7 @@ public SelectSimpleNullTest(String theEjbqlString) { } public static SelectSimpleNullTest getSimpleNotNullTest() { - SelectSimpleNullTest theTest = new SelectSimpleNullTest("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IS NOT NULL"); + SelectSimpleNullTest theTest = new SelectSimpleNullTest("SELECT OBJECT(e) FROM Employee e WHERE e.firstName IS NOT NULL"); theTest.setName("Select EJBQL Not Null Test"); ExpressionBuilder builder = new ExpressionBuilder(); @@ -38,7 +39,7 @@ public static SelectSimpleNullTest getSimpleNotNullTest() { } public static SelectSimpleNullTest getSimpleNullTest() { - SelectSimpleNullTest theTest = new SelectSimpleNullTest("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IS NULL"); + SelectSimpleNullTest theTest = new SelectSimpleNullTest("SELECT OBJECT(e) FROM Employee e WHERE e.firstName IS NULL"); theTest.setName("Select EJBQL Null Test"); ExpressionBuilder builder = new ExpressionBuilder(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleOrTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleOrTest.java index dbc52c46737..30314d2549d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleOrTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleOrTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -31,7 +32,7 @@ public void setup() { employeesUsed.add(emp2); //String partialFirstName = emp.getFirstName().substring(0, 3) + "%"; - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = " + emp1.id + " OR emp.id = " + emp2.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id = " + emp1.id + " OR e.id = " + emp2.id; //testEJBQL("FROM EmployeeBean employee WHERE employee.id = 456 OR employee.id = 756 ", false); setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleParameterTest.java index 5e44d844e42..108fa71c4e8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,8 +42,8 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = ?1 "; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseAbsTest.java index e9d8ae5a4ea..3ec8df56f79 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,9 +23,9 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(emp); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseConcatTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseConcatTest.java index b2822ca9eda..d92c8410519 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseConcatTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseConcatTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,13 +31,13 @@ public void setup() { partOne = emp.getFirstName().substring(0, 2); partTwo = emp.getFirstName().substring(2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "CONCAT(\""; ejbqlString = ejbqlString + partOne; ejbqlString = ejbqlString + "\", \""; ejbqlString = ejbqlString + partTwo; ejbqlString = ejbqlString + "\")"; - ejbqlString = ejbqlString + " = emp.firstName"; + ejbqlString = ejbqlString + " = e.firstName"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseEqualsTest.java index b0d0204f025..87bde3d390d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,9 +24,9 @@ public void setup() { String ejbqlString = null; Employee emp = (Employee)employees.firstElement(); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\""; - ejbqlString = ejbqlString + " = emp.firstName"; + ejbqlString = ejbqlString + " = e.firstName"; setEjbqlString(ejbqlString); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseLengthTest.java index ee9b4bcbd1a..97ec952a722 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -25,9 +26,9 @@ public void setup() { Employee emp = (Employee)getSomeEmployees().firstElement(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getFirstName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.firstName)"; + ejbqlString = ejbqlString + " = LENGTH(e.firstName)"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseParameterTest.java index 616b9c90bc1..356036cc080 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,8 +42,8 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "?1 = emp.firstName "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "?1 = e.firstName "; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSqrtTest.java index 11baa4be4d9..7b8cf45dec6 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,9 +25,9 @@ public void setup() { double salarySquareRoot = Math.sqrt((new Double(emp.getSalary()).doubleValue())); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + salarySquareRoot; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(emp); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSubstringTest.java index b4bde86065f..8a62a4d508c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleReverseSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,9 +28,9 @@ public void setup() { String ejbqlString; firstNamePart = emp.getFirstName().substring(0, 2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + firstNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.firstName, 1, 2)";//changed from 0, 2 to 1, 2(ZYP) + ejbqlString = ejbqlString + " = SUBSTRING(e.firstName, 1, 2)";//changed from 0, 2 to 1, 2(ZYP) setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSqrtTest.java index 115e55ad4bf..43a1161dec7 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,8 +25,8 @@ public void setup() { double salarySquareRoot = Math.sqrt((new Double(emp.getSalary()).doubleValue())); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "SQRT(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSubstringTest.java index 4738695ccf5..546e7b615e8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SelectSimpleSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,8 +28,8 @@ public void setup() { String ejbqlString; firstNamePart = emp.getFirstName().substring(0, 2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "SUBSTRING(emp.firstName, 1, 2) = \"";//changed from 0, 2 to 1, 2(ZYP) + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "SUBSTRING(e.firstName, 1, 2) = \"";//changed from 0, 2 to 1, 2(ZYP) ejbqlString = ejbqlString + firstNamePart + "\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleAbsTest.java index 9c9c93dfe54..cb41d05f668 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,8 +23,8 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "ABS(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "ABS(e.salary) = "; ejbqlString = ejbqlString + emp.getSalary(); setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleApostropheTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleApostropheTest.java index 58394280be7..3d31d93051f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleApostropheTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleApostropheTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -39,8 +40,8 @@ public void setup() { setOriginalOject(address); //test the apostrophe - ejbqlString = "SELECT OBJECT(address) FROM Address address WHERE "; - ejbqlString = ejbqlString + "address.street = '234 I''m Lost Lane'"; + ejbqlString = "SELECT OBJECT(a) FROM Address a WHERE "; + ejbqlString = ejbqlString + "a.street = '234 I''m Lost Lane'"; setEjbqlString(ejbqlString); setReferenceClass(Address.class); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenAndTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenAndTest.java index fff70873643..7909f7c12cb 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenAndTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenAndTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -34,7 +35,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); setOriginalOject(getSession().executeQuery(raq)); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id BETWEEN " + emp1 + " AND " + emp2.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id BETWEEN " + emp1 + " AND " + emp2.id; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenTest.java index 9c07b8c4233..a865b233950 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleBetweenTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -36,8 +37,8 @@ public void setup() { employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id BETWEEN "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id BETWEEN "; ejbqlString = ejbqlString + empId.toString(); ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp2.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTest.java index 8be914e1414..a8dcd8e6569 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -40,8 +41,8 @@ public void setup() { Vector employees = (Vector)getSession().executeQuery(raq); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "CONCAT(emp.firstName,emp.lastName) LIKE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "CONCAT(e.firstName, e.lastName) LIKE "; ejbqlString = ejbqlString + "\"" + partOne + "%\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTestWithConstants1.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTestWithConstants1.java index 0f591b87b5b..07511706bd8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTestWithConstants1.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleConcatTestWithConstants1.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -39,8 +40,8 @@ public void setup() { Vector employees = (Vector)getSession().executeQuery(raq); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "CONCAT(emp.firstName,\"Smith\") LIKE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "CONCAT(e.firstName,\"Smith\") LIKE "; ejbqlString = ejbqlString + "\"" + partOne + "Smith\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleDoubleOrTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleDoubleOrTest.java index bac2343c74d..9ce1a53df4c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleDoubleOrTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleDoubleOrTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -34,7 +35,7 @@ public void setup() { employeesUsed.add(emp2); employeesUsed.add(emp3); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = " + emp1.id + " OR emp.id = " + emp2.id + " OR emp.id = " + emp3.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id = " + emp1.id + " OR e.id = " + emp2.id + " OR e.id = " + emp3.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsBracketsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsBracketsTest.java index 8841b5761ca..ae73c0a461f 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsBracketsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsBracketsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,8 +25,8 @@ public void setup() { String ejbqlString = null; Employee emp = (Employee)employees.firstElement(); setOriginalOject(emp); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "( emp.firstName = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "( e.firstName = "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTest.java index 1514318ce37..5d9142e3b55 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,8 +25,8 @@ public void setup() { String ejbqlString = null; Employee emp = (Employee)employees.firstElement(); setOriginalOject(emp); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\""; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithJoin.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithJoin.java index 91362426d16..2250c6bdc68 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithJoin.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithJoin.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,7 +31,7 @@ public void setup() { getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, IN(emp.managedEmployees) managedEmployees " + "WHERE managedEmployees.address.city = 'Ottawa'"; + ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN(e.managedEmployees) me " + "WHERE me.address.city = 'Ottawa'"; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithManualJoin.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithManualJoin.java index 765853304ce..1021ce354cb 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithManualJoin.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsTestWithManualJoin.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,7 +42,7 @@ public void setup() { getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, Address address " + "WHERE emp.addressId = address.id"; + ejbqlString = "SELECT OBJECT(e) FROM Employee e, Address a " + "WHERE e.addressId = a.id"; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsWithAs.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsWithAs.java index ee67c7ddcbc..6b950d0d206 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsWithAs.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEqualsWithAs.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { Vector employeesUsed = new Vector(); employeesUsed.add(emp1); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee AS emp WHERE emp.id = " + emp1.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee AS e WHERE e.id = " + emp1.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEscapeUnderscoreTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEscapeUnderscoreTest.java index 081b5ae7265..a2c65471a38 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEscapeUnderscoreTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleEscapeUnderscoreTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -33,12 +34,12 @@ public void setup() { setOriginalOject(addressWithUnderscore); //test the apostrophe - ejbqlString = "SELECT OBJECT(address) FROM Address address WHERE "; + ejbqlString = "SELECT OBJECT(a) FROM Address a WHERE "; // \ is always treated as escape in MySQL. Therefore ESCAPE '\' is considered a syntax error if (getSession().getLogin().getPlatform().isMySQL() || getSession().getLogin().getPlatform().isPostgreSQL()) { - ejbqlString = ejbqlString + "address.street LIKE '234 Wandering $_Way' ESCAPE '$'"; + ejbqlString = ejbqlString + "a.street LIKE '234 Wandering $_Way' ESCAPE '$'"; } else { - ejbqlString = ejbqlString + "address.street LIKE '234 Wandering \\_Way' ESCAPE '\\'"; + ejbqlString = ejbqlString + "a.street LIKE '234 Wandering \\_Way' ESCAPE '\\'"; } setEjbqlString(ejbqlString); setReferenceClass(Address.class); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleFromFailed.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleFromFailed.java index c91cc8eb1ae..10f18bdcf71 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleFromFailed.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleFromFailed.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -21,7 +22,7 @@ class SimpleFromFailed extends org.eclipse.persistence.testing.tests.jpql.JPQLTe Exception error = null; public void setup() { - String ejbqlString = "SELECT OBJECT(emp) Frow Employee emp"; + String ejbqlString = "SELECT OBJECT(e) Frow Employee e"; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTest.java index f239614c922..bf687801257 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ public void setup() { emp = (Employee)getSomeEmployees().firstElement(); PhoneNumber empPhoneNumbers = (PhoneNumber)emp.getPhoneNumbers().elementAt(0); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, IN (emp.phoneNumbers) phone " + "WHERE phone.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN (e.phoneNumbers) p " + "WHERE p.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTestReversed.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTestReversed.java index 055b6cbda01..83c64efd44e 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTestReversed.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInOneDotTestReversed.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,7 @@ public void setup() { emp = (Employee)getSomeEmployees().firstElement(); PhoneNumber empPhoneNumbers = (PhoneNumber)emp.getPhoneNumbers().elementAt(0); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp, IN(emp.phoneNumbers) AS phone " + "WHERE phone.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e, IN(e.phoneNumbers) AS p " + "WHERE p.areaCode = \"" + empPhoneNumbers.getAreaCode() + "\""; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInTest.java index 7232d818e16..30be511e80a 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -21,7 +22,7 @@ public void setup() { Employee emp; emp = (Employee)getSomeEmployees().firstElement(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id IN (" + emp.getId().toString() + ")"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id IN (" + emp.getId().toString() + ")"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsEmptyTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsEmptyTest.java index 083eeb2c578..4b5e56d419e 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsEmptyTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsEmptyTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -33,7 +34,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.phoneNumbers IS EMPTY"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS EMPTY"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsNotEmptyTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsNotEmptyTest.java index 6b68eabba3e..f63de9829ab 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsNotEmptyTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleIsNotEmptyTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -33,7 +34,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.phoneNumbers IS NOT EMPTY"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS NOT EMPTY"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLengthTest.java index 3637e4fab79..a63c26376dd 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,8 +27,8 @@ public void setup() { Employee emp = (Employee)getSomeEmployees().firstElement(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "LENGTH(emp.firstName) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "LENGTH(e.firstName) = "; ejbqlString = ejbqlString + emp.getFirstName().length(); setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTest.java index 9c78a21a98c..348ebca8010 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTestWithParameter.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTestWithParameter.java index 10f76006a14..844cd1ca450 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTestWithParameter.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleLikeTestWithParameter.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -40,7 +41,7 @@ public void setup() { raq.setSelectionCriteria(whereClause); employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName LIKE ?1"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName LIKE ?1"; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleMemberOfTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleMemberOfTest.java index b9d88ed2210..d80578d2e23 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleMemberOfTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleMemberOfTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { } } - String ejbqlString = "SELECT OBJECT(proj) FROM Employee emp, Project proj " + " WHERE (proj.teamLeader MEMBER OF emp.manager.managedEmployees) " + "AND (emp.lastName = \"Chan\")"; + String ejbqlString = "SELECT OBJECT(p) FROM Employee e, Project p " + " WHERE (p.teamLeader MEMBER OF e.manager.managedEmployees) " + "AND (e.lastName = \"Chan\")"; setEjbqlString(ejbqlString); setOriginalOject(selectedProjects); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotBetweenTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotBetweenTest.java index 3d848cf9d8e..638ce22966d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotBetweenTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotBetweenTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,8 +36,8 @@ public void setup() { employees = (Vector)getSession().executeQuery(raq); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.id NOT BETWEEN "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.id NOT BETWEEN "; ejbqlString = ejbqlString + emp1.getId().toString(); ejbqlString = ejbqlString + " AND "; ejbqlString = ejbqlString + emp2.getId().toString(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsTwoVariables.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsTwoVariables.java index 4513d304333..70398df330c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsTwoVariables.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsTwoVariables.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id <> emp.manager.id"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id <> e.manager.id"; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsVariablesIngeter.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsVariablesIngeter.java index af5e592b317..f8807c90a86 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsVariablesIngeter.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotEqualsVariablesIngeter.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,7 +27,7 @@ public void setup() { emp1 = (Employee)getSomeEmployees().firstElement(); employeesUsed.remove(emp1); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id <> " + emp1.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id <> " + emp1.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); //setOriginalOject(emp1); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotInTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotInTest.java index 6bf0018a622..378de11efba 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotInTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotInTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); ////////// - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id NOT IN (" + emp.getId().toString() + ")"; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id NOT IN (" + emp.getId().toString() + ")"; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotLikeTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotLikeTest.java index fb8fb6f16ae..8134476a233 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotLikeTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotLikeTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +38,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); getSession().getIdentityMapAccessor().initializeAllIdentityMaps(); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName NOT LIKE \"" + partialFirstName + "\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName NOT LIKE \"" + partialFirstName + "\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotMemberOfTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotMemberOfTest.java index 0bfd863a1de..e71c8963bbe 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotMemberOfTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotMemberOfTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -55,7 +56,7 @@ public void setup() { } } - String ejbqlString = "SELECT OBJECT(proj) FROM Employee emp, Project proj " + " WHERE (proj.teamLeader NOT MEMBER OF emp.manager.managedEmployees) " + "AND (emp.lastName = \"Chan\")"; + String ejbqlString = "SELECT OBJECT(p) FROM Employee e, Project p " + " WHERE (p.teamLeader NOT MEMBER OF e.manager.managedEmployees) " + "AND (e.lastName = \"Chan\")"; setEjbqlString(ejbqlString); setOriginalOject(selectedProjects); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotNullTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotNullTest.java index 0dc278c34f1..fef6059aa5c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotNullTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNotNullTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +30,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); - setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IS NOT NULL"); + setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.firstName IS NOT NULL"); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNullTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNullTest.java index 7915bad0547..c07deccdb16 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNullTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleNullTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -42,7 +43,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); - setEjbqlString("SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName IS NULL"); + setEjbqlString("SELECT OBJECT(e) FROM Employee e WHERE e.firstName IS NULL"); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTest.java index 2670a5c8670..fdab48760cf 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -34,7 +35,7 @@ public void setup() { //employeesUsed.add(emp2); //employeesUsed.add(emp3); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = " + emp1.id + " OR emp.id = " + emp2.id + " AND emp.id = " + emp3.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id = " + emp1.id + " OR e.id = " + emp2.id + " AND e.id = " + emp3.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTestWithStaticNames.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTestWithStaticNames.java index a4ec8ac904b..4a58c96ed70 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTestWithStaticNames.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrFollowedByAndTestWithStaticNames.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -32,7 +33,7 @@ public void setup() { setOriginalOject(getSession().executeQuery(raq)); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.firstName = \"John\" OR emp.firstName = \"Bob\" AND emp.lastName = \"Smith\""; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.firstName = \"John\" OR e.firstName = \"Bob\" AND e.lastName = \"Smith\""; setEjbqlString(ejbqlString); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrTest.java index e4a6de18dc0..642a3b512b8 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleOrTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -30,7 +31,7 @@ public void setup() { employeesUsed.add(emp1); employeesUsed.add(emp2); - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.id = " + emp1.id + " OR emp.id = " + emp2.id; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE e.id = " + emp1.id + " OR e.id = " + emp2.id; setEjbqlString(ejbqlString); setOriginalOject(employeesUsed); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTest.java index c54e9d7cc9b..4f2fa924061 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -39,8 +40,8 @@ public void setup() { Vector employees = (Vector)getSession().executeQuery(raq, parameters); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = ?1 "; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTestChangingParameters.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTestChangingParameters.java index b786f046893..ffb325ecd56 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTestChangingParameters.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleParameterTestChangingParameters.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -53,8 +54,8 @@ public void setup() { allEmployees.addAll(secondEmployees); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "emp.firstName = ?1 "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "e.firstName = ?1 "; setEjbqlString(ejbqlString); setOriginalOject(allEmployees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseAbsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseAbsTest.java index 89a9f69214c..a1ed97d0234 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseAbsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseAbsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,9 +23,9 @@ public void setup() { String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getSalary(); - ejbqlString = ejbqlString + " = ABS(emp.salary)"; + ejbqlString = ejbqlString + " = ABS(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(emp); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseConcatTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseConcatTest.java index 7fd99d2c504..71ac70dd819 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseConcatTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseConcatTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,13 +30,13 @@ public void setup() { partOne = emp.getFirstName().substring(0, 2); partTwo = emp.getFirstName().substring(2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "CONCAT(\""; ejbqlString = ejbqlString + partOne; ejbqlString = ejbqlString + "\", \""; ejbqlString = ejbqlString + partTwo; ejbqlString = ejbqlString + "\")"; - ejbqlString = ejbqlString + " = emp.firstName"; + ejbqlString = ejbqlString + " = e.firstName"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseEqualsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseEqualsTest.java index 6d62af761d8..fc97f340d1c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseEqualsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseEqualsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,9 +24,9 @@ public void setup() { String ejbqlString = null; Employee emp = (Employee)employees.firstElement(); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + emp.getFirstName() + "\""; - ejbqlString = ejbqlString + " = emp.firstName"; + ejbqlString = ejbqlString + " = e.firstName"; setEjbqlString(ejbqlString); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseLengthTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseLengthTest.java index 1370dbcd164..ededbda1a4d 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseLengthTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseLengthTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -26,9 +27,9 @@ public void setup() { Employee emp = (Employee)getSomeEmployees().firstElement(); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + emp.getFirstName().length(); - ejbqlString = ejbqlString + " = LENGTH(emp.firstName)"; + ejbqlString = ejbqlString + " = LENGTH(e.firstName)"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseParameterTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseParameterTest.java index 7cad8bc83fc..273423a75aa 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseParameterTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseParameterTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -41,8 +42,8 @@ public void setup() { emp = (Employee)employees.firstElement(); // Set up the EJBQL using the retrieved employees - String ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "?1 = emp.firstName "; + String ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "?1 = e.firstName "; setEjbqlString(ejbqlString); setOriginalOject(employees); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSqrtTest.java index 7920470bd62..d14aad33935 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,9 +25,9 @@ public void setup() { double salarySquareRoot = Math.sqrt((new Double(emp.getSalary()).doubleValue())); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + salarySquareRoot; - ejbqlString = ejbqlString + " = SQRT(emp.salary)"; + ejbqlString = ejbqlString + " = SQRT(e.salary)"; setEjbqlString(ejbqlString); setOriginalOject(emp); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSubstringTest.java index 65f86a0521d..7ae69bb63ac 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleReverseSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,9 +28,9 @@ public void setup() { String ejbqlString; firstNamePart = emp.getFirstName().substring(0, 2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; ejbqlString = ejbqlString + "\"" + firstNamePart + "\""; - ejbqlString = ejbqlString + " = SUBSTRING(emp.firstName, 1, 2)"; + ejbqlString = ejbqlString + " = SUBSTRING(e.firstName, 1, 2)"; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSqrtTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSqrtTest.java index be1df652523..0e5011f088c 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSqrtTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSqrtTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,8 +25,8 @@ public void setup() { double salarySquareRoot = Math.sqrt((new Double(emp.getSalary()).doubleValue())); String ejbqlString; - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "SQRT(emp.salary) = "; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "SQRT(e.salary) = "; ejbqlString = ejbqlString + salarySquareRoot; setEjbqlString(ejbqlString); setOriginalOject(emp); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSubstringTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSubstringTest.java index 698f5158b10..92fbf657566 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSubstringTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SimpleSubstringTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -27,8 +28,8 @@ public void setup() { String ejbqlString; firstNamePart = emp.getFirstName().substring(0, 2); - ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE "; - ejbqlString = ejbqlString + "SUBSTRING(emp.firstName, 1, 2) = \""; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "SUBSTRING(e.firstName, 1, 2) = \""; ejbqlString = ejbqlString + firstNamePart + "\""; setEjbqlString(ejbqlString); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectMemberOfProjectsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectMemberOfProjectsTest.java index 9999a224ad8..3420f537755 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectMemberOfProjectsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectMemberOfProjectsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -42,8 +43,8 @@ public void setup() { setOriginalOject(employeesWithSmallProjects); //setup the EJBQL to do the same - ejbqlString = "SELECT OBJECT(employee) FROM Employee employee, SmallProject sp WHERE "; - ejbqlString = ejbqlString + "sp MEMBER OF employee.projects"; + ejbqlString = "SELECT OBJECT(e) FROM Employee e, SmallProject sp WHERE "; + ejbqlString = ejbqlString + "sp MEMBER OF e.projects"; setEjbqlString(ejbqlString); super.setup(); } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectNOTMemberOfProjectsTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectNOTMemberOfProjectsTest.java index 97b4020b15d..f4077a8e53b 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectNOTMemberOfProjectsTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/SmallProjectNOTMemberOfProjectsTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -49,8 +50,8 @@ public void setup() { setOriginalOject(employeesWithoutProjectEnterprise); //setup the EJBQL to do the same - ejbqlString = "SELECT OBJECT(employee) FROM Employee employee WHERE "; - ejbqlString = ejbqlString + "?1 NOT MEMBER OF employee.projects"; + ejbqlString = "SELECT OBJECT(e) FROM Employee e WHERE "; + ejbqlString = ejbqlString + "?1 NOT MEMBER OF e.projects"; setEjbqlString(ejbqlString); setArguments(arguments); super.setup(); diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/WhitespaceTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/WhitespaceTest.java index 79a4ec3b2fb..827d7b650d0 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/WhitespaceTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/jpql/WhitespaceTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -24,7 +25,7 @@ public class WhitespaceTest extends JPQLTestCase { public static WhitespaceTest getEntityWSTest1() { WhitespaceTest test = new WhitespaceTest(); test.setName("Entity Test 1"); - test.setEjbqlString("SELECT OBJECT( emp ) FROM Employee emp"); + test.setEjbqlString("SELECT OBJECT( e ) FROM Employee e"); return test; } @@ -32,7 +33,7 @@ public static WhitespaceTest getEntityWSTest1() { public static WhitespaceTest getEntityWSTest2() { WhitespaceTest test = new WhitespaceTest(); test.setName("Entity Test 2"); - test.setEjbqlString("SELECT OBJECT ( emp ) FROM Employee emp"); + test.setEjbqlString("SELECT OBJECT ( e ) FROM Employee e"); return test; } diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/performance/reading/ReadObjectPreparedvsDynamicTest.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/performance/reading/ReadObjectPreparedvsDynamicTest.java index 5aa00dd2a05..408e2a90a1b 100644 --- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/performance/reading/ReadObjectPreparedvsDynamicTest.java +++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/performance/reading/ReadObjectPreparedvsDynamicTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,7 +47,7 @@ public void setup() { query.addArgument("name"); ejbQuery = new ReadObjectQuery(Employee.class); - ejbQuery.setEJBQLString("Select Object(employee) from Employee employee where employee.firstName = :name"); + ejbQuery.setEJBQLString("Select Object(e) from Employee e where e.firstName = :name"); ejbQuery.addArgument("name"); Vector args = new Vector(); @@ -108,7 +109,7 @@ public PerformanceComparisonTestCase buildDynamicEJBQLTest() { PerformanceComparisonTestCase test = new PerformanceComparisonTestCase() { public void test() { ReadObjectQuery ejbQuery = new ReadObjectQuery(Employee.class); - ejbQuery.setEJBQLString("Select Object(employee) from Employee employee where employee.firstName = :name"); + ejbQuery.setEJBQLString("Select Object(e) from Employee e where e.firstName = :name"); ejbQuery.addArgument("name"); Vector args = new Vector(); @@ -130,7 +131,7 @@ public void test() { int size = getSession().getProject().getJPQLParseCacheMaxSize(); getSession().getProject().setJPQLParseCacheMaxSize(0); ReadObjectQuery ejbQuery = new ReadObjectQuery(Employee.class); - ejbQuery.setEJBQLString("Select Object(employee) from Employee employee where employee.firstName = :name"); + ejbQuery.setEJBQLString("Select Object(e) from Employee e where e.firstName = :name"); ejbQuery.addArgument("name"); Vector args = new Vector(); diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/QueryHints.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/QueryHints.java index 8cb8fc5ab5e..cfc339146b2 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/QueryHints.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/QueryHints.java @@ -307,8 +307,8 @@ public class QueryHints { /** * "eclipselink.batch.size" *

Configures the batch size for batch fetching using the IN batch type. - * Valid values are integer values {@literal >} 0. - * The default size is 256, or the cursor pageSize. + * Valid values are integer values {@literal >=} 0. + * The default size is 500, or the cursor pageSize. * @see #BATCH * @see #BATCH_TYPE * @see BatchFetchType diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java index 25e22d298ac..740c07e0d58 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java @@ -266,6 +266,17 @@ public class DatabasePlatform extends DatasourcePlatform { protected Boolean useJDBCStoredProcedureSyntax; protected String driverName; + /** + * True if the current jdbc driver supports get/setNString methods + */ + protected boolean driverSupportsNationalCharacterVarying = false; + + /** + * If true, the platform should map String columns to a type that supports + * national characters. + */ + protected boolean useNationalCharacterVarying = false; + /** * Creates an instance of default database platform. */ @@ -460,7 +471,7 @@ protected void appendNumber(Number number, Writer writer) throws IOException { */ public void appendLiteralToCall(Call call, Writer writer, Object literal) { if(shouldBindLiterals()) { - appendLiteralToCallWithBinding(call, writer, literal); + ((DatabaseCall)call).appendLiteral(writer, literal); } else { int nParametersToAdd = appendParameterInternal(call, writer, literal); for (int i = 0; i < nParametersToAdd; i++) { @@ -469,16 +480,6 @@ public void appendLiteralToCall(Call call, Writer writer, Object literal) { } } - /** - * INTERNAL: - * Override this method in case the platform needs to do something special for binding literals. - * Note that instead of null value a DatabaseField - * value may be passed (so that it's type could be used for binding null). - */ - protected void appendLiteralToCallWithBinding(Call call, Writer writer, Object literal) { - ((DatabaseCall)call).appendLiteral(writer, literal); - } - /** * Write a database-friendly representation of the given parameter to the writer. * Determine the class of the object to be written, and invoke the appropriate print method @@ -491,79 +492,6 @@ public void appendParameter(Call call, Writer writer, Object parameter) { appendParameterInternal(call, writer, parameter); } - /** - * Returns the number of parameters that used binding. - * Should only be called in case binding is not used. - */ - public int appendParameterInternal(Call call, Writer writer, Object parameter) { - int nBoundParameters = 0; - DatabaseCall databaseCall = (DatabaseCall)call; - try { - // PERF: Print Calendars directly avoiding timestamp conversion, - // Must be before conversion as you cannot bind calendars. - if (parameter instanceof Calendar) { - appendCalendar((Calendar)parameter, writer); - return nBoundParameters; - } - Object dbValue = convertToDatabaseType(parameter); - - if (dbValue instanceof String) {// String and number first as they are most common. - if (usesStringBinding() && (((String)dbValue).length() >= getStringBindingSize())) { - databaseCall.bindParameter(writer, dbValue); - nBoundParameters = 1; - } else { - appendString((String)dbValue, writer); - } - } else if (dbValue instanceof Number) { - appendNumber((Number)dbValue, writer); - } else if (dbValue instanceof java.sql.Time) { - appendTime((java.sql.Time)dbValue, writer); - } else if (dbValue instanceof java.sql.Timestamp) { - appendTimestamp((java.sql.Timestamp)dbValue, writer); - } else if (dbValue instanceof java.sql.Date) { - appendDate((java.sql.Date)dbValue, writer); - } else if (dbValue == null) { - writer.write("NULL"); - } else if (dbValue instanceof Boolean) { - appendBoolean((Boolean)dbValue, writer); - } else if (dbValue instanceof byte[]) { - if (usesByteArrayBinding()) { - databaseCall.bindParameter(writer, dbValue); - nBoundParameters = 1; - } else { - appendByteArray((byte[])dbValue, writer); - } - } else if (dbValue instanceof Collection) { - nBoundParameters = printValuelist((Collection)dbValue, databaseCall, writer); - } else if (typeConverters != null && typeConverters.containsKey(dbValue.getClass())){ - dbValue = new BindCallCustomParameter(dbValue); - // custom binding is required, object to be bound is wrapped (example NCHAR, NVARCHAR2, NCLOB on Oracle9) - databaseCall.bindParameter(writer, dbValue); - } else if ((parameter instanceof Struct) || (parameter instanceof Array) || (parameter instanceof Ref)) { - databaseCall.bindParameter(writer, parameter); - nBoundParameters = 1; - } else if (dbValue.getClass() == int[].class) { - nBoundParameters = printValuelist((int[])dbValue, databaseCall, writer); - } else if (dbValue instanceof AppendCallCustomParameter) { - // custom append is required (example BLOB, CLOB on Oracle8) - ((AppendCallCustomParameter)dbValue).append(writer); - nBoundParameters = 1; - } else if (dbValue instanceof BindCallCustomParameter) { - // custom binding is required, object to be bound is wrapped (example NCHAR, NVARCHAR2, NCLOB on Oracle9) - databaseCall.bindParameter(writer, dbValue); - nBoundParameters = 1; - } else { - // Assume database driver primitive that knows how to print itself, this is required for drivers - // such as Oracle JDBC, Informix JDBC and others, as well as client specific classes. - writer.write(dbValue.toString()); - } - } catch (IOException exception) { - throw ValidationException.fileError(exception); - } - - return nBoundParameters; - } - /** * Write the string. Quotes must be double quoted. */ @@ -638,7 +566,6 @@ public void beginTransaction(DatabaseAccessor accessor) throws SQLException { * Return the selection criteria used to IN batch fetching. */ public Expression buildBatchCriteria(ExpressionBuilder builder,Expression field) { - return field.in( builder.getParameter(ForeignReferenceMapping.QUERY_BATCH_PARAMETER)); } @@ -768,16 +695,6 @@ public boolean shouldUseGetSetNString() { return getDriverSupportsNVarChar() && getUseNationalCharacterVaryingTypeForString(); } - /** - * True if the current jdbc driver supports get/setNString methods - */ - protected boolean driverSupportsNationalCharacterVarying = false; - /** - * If true, the platform should map String columns to a type that supports - * national characters. - */ - protected boolean useNationalCharacterVarying = false; - public boolean getDriverSupportsNVarChar() { return driverSupportsNationalCharacterVarying; } @@ -3187,7 +3104,7 @@ public void writeParameterMarker(Writer writer, ParameterExpression expression, public Array createArray(String elementDataTypeName, Object[] elements, AbstractSession session, Connection connection) throws SQLException { //Bug#5200836 need unwrap the connection prior to using. java.sql.Connection unwrappedConnection = getConnection(session, connection); - return createArray(elementDataTypeName,elements,unwrappedConnection); + return unwrappedConnection.createArrayOf(elementDataTypeName, elements); } /** @@ -3197,25 +3114,7 @@ public Array createArray(String elementDataTypeName, Object[] elements, Abstract */ public Struct createStruct(String structTypeName, Object[] attributes, AbstractSession session, Connection connection) throws SQLException { java.sql.Connection unwrappedConnection = getConnection(session, connection); - return createStruct(structTypeName,attributes,unwrappedConnection); - } - - /** - * INTERNAL: - * Platforms that support java.sql.Array may override this method. - * @return Array - */ - public Array createArray(String elementDataTypeName, Object[] elements, Connection connection) throws SQLException { - return connection.createArrayOf(elementDataTypeName, elements); - } - - /** - * INTERNAL: - * Platforms that support java.sql.Struct may override this method. - * @return Struct - */ - public Struct createStruct(String structTypeName, Object[] attributes, Connection connection) throws SQLException { - return connection.createStruct(structTypeName, attributes); + return unwrappedConnection.createStruct(structTypeName, attributes); } /** @@ -3254,23 +3153,14 @@ public boolean isDynamicSQLRequiredForFunctions() { return false; } - /** - * INTERNAL: - * Platforms that support java.sql.Ref may override this method. - * @return Object - */ - public Object getRefValue(Ref ref,Connection connection) throws SQLException { - return ref.getObject(); - } /** * INTERNAL: * This method builds a REF using the unwrapped connection within the session * @return Object */ - public Object getRefValue(Ref ref,AbstractSession executionSession,Connection connection) throws SQLException { //Bug#6068155, ensure connection is lived when processing the REF type value. - java.sql.Connection unwrappedConnection = getConnection(executionSession,connection); - return getRefValue(ref,unwrappedConnection); + public Object getRefValue(Ref ref, AbstractSession session, Connection connection) throws SQLException { + return ref.getObject(); } @@ -3571,4 +3461,76 @@ public boolean checkTableExists(final DatabaseSessionImpl session, } } + /** + * Returns the number of parameters that used binding. + * Should only be called in case binding is not used. + */ + private int appendParameterInternal(Call call, Writer writer, Object parameter) { + int nBoundParameters = 0; + DatabaseCall databaseCall = (DatabaseCall)call; + try { + // PERF: Print Calendars directly avoiding timestamp conversion, + // Must be before conversion as you cannot bind calendars. + if (parameter instanceof Calendar) { + appendCalendar((Calendar)parameter, writer); + return nBoundParameters; + } + Object dbValue = convertToDatabaseType(parameter); + + if (dbValue instanceof String) {// String and number first as they are most common. + if (usesStringBinding() && (((String)dbValue).length() >= getStringBindingSize())) { + databaseCall.bindParameter(writer, dbValue); + nBoundParameters = 1; + } else { + appendString((String)dbValue, writer); + } + } else if (dbValue instanceof Number) { + appendNumber((Number)dbValue, writer); + } else if (dbValue instanceof java.sql.Time) { + appendTime((java.sql.Time)dbValue, writer); + } else if (dbValue instanceof java.sql.Timestamp) { + appendTimestamp((java.sql.Timestamp)dbValue, writer); + } else if (dbValue instanceof java.sql.Date) { + appendDate((java.sql.Date)dbValue, writer); + } else if (dbValue == null) { + writer.write("NULL"); + } else if (dbValue instanceof Boolean) { + appendBoolean((Boolean)dbValue, writer); + } else if (dbValue instanceof byte[]) { + if (usesByteArrayBinding()) { + databaseCall.bindParameter(writer, dbValue); + nBoundParameters = 1; + } else { + appendByteArray((byte[])dbValue, writer); + } + } else if (dbValue instanceof Collection) { + nBoundParameters = printValuelist((Collection)dbValue, databaseCall, writer); + } else if (typeConverters != null && typeConverters.containsKey(dbValue.getClass())){ + dbValue = new BindCallCustomParameter(dbValue); + // custom binding is required, object to be bound is wrapped (example NCHAR, NVARCHAR2, NCLOB on Oracle9) + databaseCall.bindParameter(writer, dbValue); + } else if ((parameter instanceof Struct) || (parameter instanceof Array) || (parameter instanceof Ref)) { + databaseCall.bindParameter(writer, parameter); + nBoundParameters = 1; + } else if (dbValue.getClass() == int[].class) { + nBoundParameters = printValuelist((int[])dbValue, databaseCall, writer); + } else if (dbValue instanceof AppendCallCustomParameter) { + // custom append is required (example BLOB, CLOB on Oracle8) + ((AppendCallCustomParameter)dbValue).append(writer); + nBoundParameters = 1; + } else if (dbValue instanceof BindCallCustomParameter) { + // custom binding is required, object to be bound is wrapped (example NCHAR, NVARCHAR2, NCLOB on Oracle9) + databaseCall.bindParameter(writer, dbValue); + nBoundParameters = 1; + } else { + // Assume database driver primitive that knows how to print itself, this is required for drivers + // such as Oracle JDBC, Informix JDBC and others, as well as client specific classes. + writer.write(dbValue.toString()); + } + } catch (IOException exception) { + throw ValidationException.fileError(exception); + } + + return nBoundParameters; + } } diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/ObjectExpression.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/ObjectExpression.java index 52dd58d2731..14c09ccac16 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/ObjectExpression.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/ObjectExpression.java @@ -211,7 +211,7 @@ public Expression anyOf(String attributeName, boolean shouldJoinBeIndependent) { } else { queryKey = derivedExpressionNamed(attributeName); } - queryKey.doQueryToManyRelationship(); + queryKey.setShouldQueryToManyRelationship(true); return queryKey; } @@ -235,8 +235,8 @@ public Expression anyOfAllowingNone(String attributeName, boolean shouldJoinBeIn } else { queryKey = derivedExpressionNamed(attributeName); } - queryKey.doUseOuterJoin(); - queryKey.doQueryToManyRelationship(); + queryKey.setShouldUseOuterJoin(true); + queryKey.setShouldQueryToManyRelationship(true); return queryKey; } @@ -357,12 +357,12 @@ public Expression derivedManualExpressionNamed(String attributeName, ClassDescri } - public void doNotUseOuterJoin() { - shouldUseOuterJoin = false; + public void setShouldUseOuterJoin(boolean shouldUseOuterJoin) { + this.shouldUseOuterJoin = shouldUseOuterJoin; } - public void doUseOuterJoin() { - shouldUseOuterJoin = true; + public boolean shouldUseOuterJoin() { + return shouldUseOuterJoin; } public QueryKeyExpression existingDerivedExpressionNamed(String attributeName) { @@ -389,7 +389,7 @@ public QueryKeyExpression existingDerivedExpressionNamed(String attributeName) { public Expression get(String attributeName, boolean forceInnerJoin) { ObjectExpression result = derivedExpressionNamed(attributeName); if (forceInnerJoin) { - result.doNotUseOuterJoin(); + result.setShouldUseOuterJoin(false); } return result; } @@ -400,7 +400,7 @@ public Expression get(String attributeName, boolean forceInnerJoin) { @Override public Expression leftJoin(Expression target, Expression onClause) { join(target, onClause); - ((ObjectExpression)target).doUseOuterJoin(); + ((ObjectExpression)target).setShouldUseOuterJoin(true); return this; } @@ -428,7 +428,7 @@ public Expression getAllowingNull(String attributeName) { return exp; } ObjectExpression result = derivedExpressionNamed(attributeName); - result.doUseOuterJoin(); + result.setShouldUseOuterJoin(true); return result; } @@ -731,10 +731,6 @@ public void setShouldUseOuterJoinForMultitableInheritance(boolean shouldUseOuter this.shouldUseOuterJoinForMultitableInheritance = shouldUseOuterJoinForMultitableInheritance; } - public boolean shouldUseOuterJoin() { - return shouldUseOuterJoin; - } - public boolean shouldUseOuterJoinForMultitableInheritance() { return shouldUseOuterJoinForMultitableInheritance; } diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/QueryKeyExpression.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/QueryKeyExpression.java index a5edaf4c6e5..7c48e408922 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/QueryKeyExpression.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/QueryKeyExpression.java @@ -295,12 +295,9 @@ protected void postCopyIn(Map alreadyDone) { public String descriptionOfNodeType() { return "Query Key"; } - - /** - * INTERNAL: - */ - public void doQueryToManyRelationship() { - shouldQueryToManyRelationship = true; + + public void setShouldQueryToManyRelationship(boolean shouldQueryToManyRelationship) { + this.shouldQueryToManyRelationship = shouldQueryToManyRelationship; } /** @@ -945,7 +942,7 @@ public Expression rebuildOn(Expression newBase) { result = (QueryKeyExpression)newLocalBase.get(getName()); } if (shouldQueryToManyRelationship) { - result.doQueryToManyRelationship(); + result.setShouldQueryToManyRelationship(true); } result.setSelectIfOrderedBy(selectIfOrderedBy()); if (castClass != null){ @@ -976,7 +973,7 @@ public Expression rebuildOn(Expression oldBase, Expression newBase) { result = (QueryKeyExpression)newLocalBase.get(getName()); } if (shouldQueryToManyRelationship) { - result.doQueryToManyRelationship(); + result.setShouldQueryToManyRelationship(true); } result.setSelectIfOrderedBy(selectIfOrderedBy()); return result; @@ -1010,10 +1007,10 @@ public Expression twistedForBaseAndContext(Expression newBase, Expression contex Expression twistedBase = this.baseExpression.twistedForBaseAndContext(newBase, context, oldBase); QueryKeyExpression result = (QueryKeyExpression)twistedBase.get(getName()); if (shouldUseOuterJoin) { - result.doUseOuterJoin(); + result.setShouldUseOuterJoin(true); } if (shouldQueryToManyRelationship) { - result.doQueryToManyRelationship(); + result.setShouldQueryToManyRelationship(true); } return result; } diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/TreatAsExpression.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/TreatAsExpression.java index cd8a9d61a5f..b38e441333a 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/TreatAsExpression.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions/TreatAsExpression.java @@ -147,10 +147,10 @@ public Expression twistedForBaseAndContext(Expression newBase, Expression twistedBase = this.typeExpressionBase.twistedForBaseAndContext(newBase, context, oldBase); TreatAsExpression result = (TreatAsExpression)twistedBase.treat(this.castClass); if (shouldUseOuterJoin) { - result.doUseOuterJoin(); + result.setShouldUseOuterJoin(true); } if (shouldQueryToManyRelationship) { - result.doQueryToManyRelationship(); + result.setShouldQueryToManyRelationship(true); } return result; } diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/AbstractObjectLevelReadQueryVisitor.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/AbstractObjectLevelReadQueryVisitor.java index 551e021514b..7c70f92e2af 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/AbstractObjectLevelReadQueryVisitor.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/AbstractObjectLevelReadQueryVisitor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2006, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -311,7 +312,7 @@ void visitAbstractSelectClause(AbstractSelectClause expression) { // This means we want nulls returned if we expect an outer join // True: SELECT employee.address FROM ..... // Simple 1:1 // True: SELECT a.b.c.d FROM ..... // where a->b, b->c and c->d are all 1:1. - // False: SELECT OBJECT(employee) FROM ..... // simple SELECT + // False: SELECT OBJECT(e) FROM ..... // simple SELECT // False: SELECT phoneNumber.areaCode FROM ..... // direct-to-field OneToOneSelectedVisitor visitor = new OneToOneSelectedVisitor(); expression.accept(visitor); diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/DerivedDeclaration.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/DerivedDeclaration.java index ccabf502662..f176b2d638f 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/DerivedDeclaration.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/DerivedDeclaration.java @@ -67,8 +67,7 @@ Expression buildQueryExpression() { } return expression; - } - else { + } else { // Otherwise it will be derived by duplicating the join to the outer builder inside the // sub select. The same could be done for direct collection, but difficult to create a diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/JPQLQueryContext.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/JPQLQueryContext.java index 5683dadaf19..a456305b541 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/JPQLQueryContext.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/jpql/JPQLQueryContext.java @@ -1157,4 +1157,4 @@ TypeResolver typeResolver() { return typeResolver; } -} +} \ No newline at end of file diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/ParseTree.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/ParseTree.java index e522135515b..acdfc478cff 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/ParseTree.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/ParseTree.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -594,7 +595,7 @@ public String toString() { * INTERNAL * Verify that the alias in the SELECT is valid. * Invalid: SELECT OBJECT(badAlias) FROM Employee employee.... - * Valid: SELECT OBJECT(employee) FROM Employee employee.... + * Valid: SELECT OBJECT(e) FROM Employee e.... */ public void verifySelect(DatabaseQuery theQuery, GenerationContext generationContext) { if (theQuery.isObjectLevelReadQuery()) { diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/SelectNode.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/SelectNode.java index e381266802e..2bb1b9a0878 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/SelectNode.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/jpa/parsing/SelectNode.java @@ -1,5 +1,6 @@ /* * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -211,7 +212,7 @@ public boolean hasOneToOneSelected(GenerationContext context) { * This includes a chain of relationships. * True: SELECT employee.address FROM ..... //Simple 1:1 * True: SELECT a.b.c.d FROM ..... //where a->b, b->c and c->d are all 1:1. - * False: SELECT OBJECT(employee) FROM ..... //simple SELECT + * False: SELECT OBJECT(e) FROM ..... //simple SELECT * False: SELECT phoneNumber.areaCode FROM ..... //direct-to-field */ private boolean hasOneToOneSelected(Node node, GenerationContext context) { diff --git a/foundation/org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database/oracle/Oracle8Platform.java b/foundation/org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database/oracle/Oracle8Platform.java index 89d1996eeb1..b298a4c8d1f 100644 --- a/foundation/org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database/oracle/Oracle8Platform.java +++ b/foundation/org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database/oracle/Oracle8Platform.java @@ -272,8 +272,9 @@ public void setLobValueLimits(int lobValueLimits) { * @return Array */ @Override - public Array createArray(String elementDataTypeName, Object[] elements, Connection connection) throws SQLException { - return new oracle.sql.ARRAY(new oracle.sql.ArrayDescriptor(elementDataTypeName, connection), connection, elements); + public Array createArray(String elementDataTypeName, Object[] elements, AbstractSession session, Connection connection) throws SQLException { + java.sql.Connection unwrappedConnection = getConnection(session, connection); + return new oracle.sql.ARRAY(new oracle.sql.ArrayDescriptor(elementDataTypeName, unwrappedConnection), unwrappedConnection, elements); } /** @@ -282,8 +283,9 @@ public Array createArray(String elementDataTypeName, Object[] elements, Connecti * @return Struct */ @Override - public Struct createStruct(String structTypeName, Object[] attributes, Connection connection) throws SQLException { - return new oracle.sql.STRUCT(new oracle.sql.StructDescriptor(structTypeName, connection), connection, attributes); + public Struct createStruct(String structTypeName, Object[] attributes, AbstractSession session, Connection connection) throws SQLException { + java.sql.Connection unwrappedConnection = getConnection(session, connection); + return new oracle.sql.STRUCT(new oracle.sql.StructDescriptor(structTypeName, unwrappedConnection), unwrappedConnection, attributes); } /** @@ -292,8 +294,9 @@ public Struct createStruct(String structTypeName, Object[] attributes, Connectio * @return String */ @Override - public Object getRefValue(Ref ref,Connection connection) throws SQLException { - ((oracle.sql.REF)ref).setPhysicalConnectionOf(connection); + public Object getRefValue(Ref ref, AbstractSession session, Connection connection) throws SQLException { + java.sql.Connection unwrappedConnection = getConnection(session, connection); + ((oracle.sql.REF)ref).setPhysicalConnectionOf(unwrappedConnection); return ((oracle.sql.REF)ref).getValue(); } diff --git a/jpa/eclipselink.jaxrs.test/antbuild.properties b/jpa/eclipselink.jaxrs.test/antbuild.properties index 8a50c7e4b29..b0c0d018a67 100644 --- a/jpa/eclipselink.jaxrs.test/antbuild.properties +++ b/jpa/eclipselink.jaxrs.test/antbuild.properties @@ -74,4 +74,4 @@ eclipselink.modelgen.processor.prefix=eclipselink-jpa-modelgen coretest.framework.jar=eclipselink-coretest-framework.jar coretest.jar=eclipselink-core-tests.jar jpatest.framework.jar=eclipselink-jpatest-framework.jar -jpa.test.jar=eclipselink-jpa-tests.jar +jpa21.test.jar=eclipselink-jpa21-tests.jar diff --git a/jpa/eclipselink.jpa.test.jse/src/org/eclipse/persistence/config/TestPropertiesUtils.java b/jpa/eclipselink.jpa.test.jse/src/org/eclipse/persistence/config/TestPropertiesUtils.java index a3839b5e5d9..a94b7868a2f 100644 --- a/jpa/eclipselink.jpa.test.jse/src/org/eclipse/persistence/config/TestPropertiesUtils.java +++ b/jpa/eclipselink.jpa.test.jse/src/org/eclipse/persistence/config/TestPropertiesUtils.java @@ -85,11 +85,11 @@ public void testInvalidConfiguration() { @Test public void testStoredProcedureTerminationToken() { DB2Platform db2 = new DB2Platform(); - Assert.assertTrue(db2.getStoredProcedureTerminationToken().equals(";")); + Assert.assertEquals(";", db2.getStoredProcedureTerminationToken()); String token = "test"; PropertiesUtils.set(db2, PersistenceUnitProperties.TARGET_DATABASE_PROPERTIES, "StoredProcedureTerminationToken=" + token); - Assert.assertTrue(db2.getStoredProcedureTerminationToken().equals(token)); + Assert.assertEquals(token, db2.getStoredProcedureTerminationToken()); } } diff --git a/jpa/eclipselink.jpa.test/antbuild.properties b/jpa/eclipselink.jpa.test/antbuild.properties index 3beb6435d10..94922e345e1 100644 --- a/jpa/eclipselink.jpa.test/antbuild.properties +++ b/jpa/eclipselink.jpa.test/antbuild.properties @@ -97,7 +97,7 @@ oracle.test.jar=eclipselink-oracle-tests.jar oracle.jpa.test.jar=eclipselink-oracle-jpa-tests.jar oracle.spatial.jpa.test.jar=eclipselink-oracle-spatial-jpa-test.jar nosql.jpa.test.jar=eclipselink-nosql-jpa-tests.jar -jpa.test.jar=eclipselink-jpa-tests.jar +jpa21.test.jar=eclipselink-jpa21-tests.jar jpa22.test.jar=eclipselink-jpa22-tests.jar #JPA Canonical Test Model Definitions diff --git a/jpa/eclipselink.jpa.test/antbuild.xml b/jpa/eclipselink.jpa.test/antbuild.xml index dcfc8600f5d..732d0b22c4a 100644 --- a/jpa/eclipselink.jpa.test/antbuild.xml +++ b/jpa/eclipselink.jpa.test/antbuild.xml @@ -254,7 +254,7 @@ - + @@ -272,20 +272,22 @@ - - - + + + + - + + - + @@ -310,17 +312,17 @@ - + - + - + - + @@ -372,7 +374,7 @@ - + @@ -388,7 +390,12 @@ - + + + + + + @@ -398,7 +405,7 @@ - + @@ -425,14 +432,14 @@ - + - + @@ -450,7 +457,7 @@ - + @@ -467,7 +474,7 @@ - + @@ -1242,7 +1249,7 @@ package-xml-extended-composite-advanced, package-xml-extended-composite-advanced-member_1, package-xml-extended-composite-advanced-member_2, package-xml-extended-composite-advanced-member_3, package-extensibility, package-jpa-remote, package-identity-model, package-xml-mapping-metadata-complete" description="build EclipseLink jar"> - + - - + - - @@ -2108,7 +2115,7 @@ - + @@ -2123,7 +2130,7 @@ - + @@ -2371,7 +2378,7 @@ - + org.eclipse.persistence.testing.models.jpa21.advanced.converters.TagConverter org.eclipse.persistence.testing.models.jpa21.advanced.converters.TimeConverter org.eclipse.persistence.testing.models.jpa21.advanced.converters.ResponsibilityConverter + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Boat + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Bus + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Car + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Company + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Computer + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.ComputerPK + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Desktop + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Engineer + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.FueledVehicle + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Jalopy + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Laptop + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Lawyer + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.NonFueledVehicle + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.OffRoadTireInfo + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.PassengerPerformanceTireInfo + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.PerformanceTireInfo + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Person + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.SportsCar + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.TireInfo + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.Vehicle + org.eclipse.persistence.testing.models.jpa21.advanced.inheritance.VehicleDirectory + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Alpine + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Becks + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.BecksTag + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Beer + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.BeerConsumer + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Beverage + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Blue + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.BlueLight + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Canadian + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Certification + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Consumable + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Corona + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.Heineken + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.RedStripe + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.SerialNumber + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.TelephoneNumber + org.eclipse.persistence.testing.models.jpa21.advanced.inherited.TelephoneNumberPK true diff --git a/jpa/eclipselink.jpa.test/resource/eclipselink-jpa21-model/server/persistence.xml b/jpa/eclipselink.jpa.test/resource/eclipselink-jpa21-model/server/persistence.xml index de00d16adb8..89a6b16998a 100644 --- a/jpa/eclipselink.jpa.test/resource/eclipselink-jpa21-model/server/persistence.xml +++ b/jpa/eclipselink.jpa.test/resource/eclipselink-jpa21-model/server/persistence.xml @@ -1,6 +1,7 @@ Employee List results0 = (List) allResults.get(0); @@ -749,14 +749,14 @@ public void testQueryWithMultipleResultsFromCode() throws Exception { for (Object result2 : results2) { Object[] result2Element = (Object[]) result2; - assertTrue("Failed to Return 3 items", (result2Element.length == 3)); + assertEquals("Failed to Return 3 items", 3, result2Element.length); // Using Number as Different db/drivers can return different types // e.g. Oracle with ijdbc14.jar returns BigDecimal where as Derby // with derbyclient.jar returns Double. NOTE: the order of checking // here is valid and as defined by the spec. assertTrue("Failed to return LargeProject", (result2Element[0] instanceof LargeProject)); assertTrue("Failed To Return SmallProject", (result2Element[1] instanceof SmallProject)); - assertTrue("Failed to return column",(result2Element[2] instanceof Number)); + assertTrue("Failed to return column", (result2Element[2] instanceof Number)); assertFalse("Returned same data in both result elements",((SmallProject) result2Element[1]).getName().equals(((LargeProject) result2Element[0]).getName())); } @@ -794,9 +794,10 @@ public void testQueryWithNamedFieldResult() { query.registerStoredProcedureParameter("address_id_v", Integer.class, ParameterMode.IN); Object[] values = (Object[]) query.setParameter("address_id_v", address.getId()).getSingleResult(); - assertTrue("Address data not found or returned using stored procedure", ((values != null) && (values.length == 6))); + assertNotNull("Query results returned null", values); + assertEquals("Address data not found or returned using stored procedure", 6, values.length); assertNotNull("No results returned from store procedure call", values[1]); - assertTrue("Address not found using stored procedure", address.getStreet().equals(values[1])); + assertEquals("Address not found using stored procedure", values[1], address.getStreet()); } finally { closeEntityManagerAndTransaction(em); } @@ -830,16 +831,16 @@ public void testQueryWithNumberedFieldResult() { StoredProcedureQuery query = em.createNamedStoredProcedureQuery("ReadAddressMappedNumberedFieldResult"); List

addresses = query.setParameter(1, address1.getId()).getResultList(); - assertTrue("Too many addresses returned", addresses.size() == 1); + assertEquals("Too many addresses returned", 1, addresses.size()); Address address2 = addresses.get(0); assertNotNull("Address returned from stored procedure is null", address2); - assertTrue("Address didn't build correctly using stored procedure", (address1.getId() == address2.getId())); - assertTrue("Address didn't build correctly using stored procedure", (address1.getStreet().equals(address2.getStreet()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getCountry().equals(address2.getCountry()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getProvince().equals(address2.getProvince()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getPostalCode().equals(address2.getPostalCode()))); + assertEquals("Address id didn't build correctly using stored procedure", address1.getId(), address2.getId()); + assertEquals("Address street didn't build correctly using stored procedure", address1.getStreet(), address2.getStreet()); + assertEquals("Address country didn't build correctly using stored procedure", address1.getCountry(), address2.getCountry()); + assertEquals("Address province didn't build correctly using stored procedure", address1.getProvince(), address2.getProvince()); + assertEquals("Address postalcode didn't build correctly using stored procedure", address1.getPostalCode(), address2.getPostalCode()); } finally { closeEntityManagerAndTransaction(em); } @@ -874,11 +875,11 @@ public void testQueryWithResultClass() { Address address2 = (Address) query.setParameter("address_id_v", address1.getId()).getSingleResult(); assertNotNull("Address returned from stored procedure is null", address2); - assertTrue("Address didn't build correctly using stored procedure", (address1.getId() == address2.getId())); - assertTrue("Address didn't build correctly using stored procedure", (address1.getStreet().equals(address2.getStreet()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getCountry().equals(address2.getCountry()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getProvince().equals(address2.getProvince()))); - assertTrue("Address didn't build correctly using stored procedure", (address1.getPostalCode().equals(address2.getPostalCode()))); + assertEquals("Address id didn't build correctly using stored procedure", address1.getId(), address2.getId()); + assertEquals("Address street didn't build correctly using stored procedure", address1.getStreet(), address2.getStreet()); + assertEquals("Address country didn't build correctly using stored procedure", address1.getCountry(), address2.getCountry()); + assertEquals("Address province didn't build correctly using stored procedure", address1.getProvince(), address2.getProvince()); + assertEquals("Address postalcode didn't build correctly using stored procedure", address1.getPostalCode(), address2.getPostalCode()); } finally { closeEntityManagerAndTransaction(em); } @@ -914,7 +915,7 @@ public void testQueryWithOutParam() { boolean result = query.setParameter("address_id_v", address.getId()).execute(); String city = (String) query.getOutputParameterValue("city_v"); - assertTrue("Incorrect city was returned.", (address.getCity().equals(city))); + assertEquals("Incorrect city was returned.", address.getCity(), city); } finally { closeEntityManagerAndTransaction(em); } @@ -968,7 +969,7 @@ public void testStoredProcedureQuerySysCursor_Named() { query.registerStoredProcedureParameter("p_recordset", void.class, ParameterMode.REF_CURSOR); // Test the getParameters call BEFORE query execution. - assertTrue("The number of parameters returned was incorrect, actual: " + query.getParameters().size() + ", expected 2", query.getParameters().size() == 2); + assertEquals("The number of parameters returned was incorrect", 2, query.getParameters().size()); query.setParameter("f_name_v", "Fred"); @@ -998,7 +999,7 @@ public void testStoredProcedureQuerySysCursor_Positional() { query.registerStoredProcedureParameter(2, void.class, ParameterMode.REF_CURSOR); // Test the getParameters call BEFORE query execution. - assertTrue("The number of parameters returned was incorrect, actual: " + query.getParameters().size() + ", expected 2", query.getParameters().size() == 2); + assertEquals("The number of parameters returned was incorrect", 2, query.getParameters().size()); query.setParameter(1, "Fred"); @@ -1037,7 +1038,7 @@ public void testStoredProcedureQuerySysCursor2() { assertTrue("Execute returned false.", execute); // Test the getParameters call AFTER query execution. - assertTrue("The number of paramters returned was incorrect, actual: " + query.getParameters().size() + ", expected 2", query.getParameters().size() == 2); + assertEquals("The number of paramters returned was incorrect", 2, query.getParameters().size()); List employees = (List) query.getOutputParameterValue("p_recordset"); assertFalse("No employees were returned", employees.isEmpty()); diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa21/advanced/WeaverTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa21/advanced/WeaverTestSuite.java index e9a55d000d7..4bb8e4f3984 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa21/advanced/WeaverTestSuite.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa21/advanced/WeaverTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -22,7 +23,6 @@ import org.eclipse.persistence.internal.descriptors.PersistenceEntity; import org.eclipse.persistence.testing.framework.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa21.advanced.WovenMS; -import org.junit.Assert; import junit.framework.Test; import junit.framework.TestSuite; @@ -54,6 +54,6 @@ public void testMappedSuperclassWeaving() { EntityManagerFactory emf = getEntityManagerFactory(); ManagedType managedType = emf.getMetamodel().managedType(WovenMS.class); Class javaClass = emf.getMetamodel().managedType(WovenMS.class).getJavaType(); - Assert.assertTrue(Arrays.asList(javaClass.getInterfaces()).contains(PersistenceEntity.class)); + assertTrue(Arrays.asList(javaClass.getInterfaces()).contains(PersistenceEntity.class)); } } diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/ConverterTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/ConverterTestSuite.java index 2ddffb5db84..c11e51e2d66 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/ConverterTestSuite.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/ConverterTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -160,11 +161,11 @@ public void testAnnotationConverters() { clearCache(); Runner runnerRefreshed = em.find(Runner.class, runner.getId()); - assertTrue("The age conversion did not work.", runnerRefreshed.getAge() == 52); - assertTrue("The embeddable health conversion did not work.", runnerRefreshed.getInfo().getHealth().equals(Health.HEALTHY)); - assertTrue("The embeddable level conversion did not work.", runnerRefreshed.getInfo().getLevel().equals(Level.AMATEUR)); - assertTrue("The nested embeddable running status conversion did not work.", runnerRefreshed.getInfo().getStatus().getRunningStatus().equals(RunningStatus.DOWN_TIME)); - assertTrue("The number of personal bests for this runner is incorrect.", runnerRefreshed.getPersonalBests().size() == 2); + assertEquals("The age conversion did not work.", new Integer(52), runnerRefreshed.getAge()); + assertEquals("The embeddable health conversion did not work.", Health.HEALTHY, runnerRefreshed.getInfo().getHealth()); + assertEquals("The embeddable level conversion did not work.", Level.AMATEUR, runnerRefreshed.getInfo().getLevel()); + assertEquals("The nested embeddable running status conversion did not work.", RunningStatus.DOWN_TIME, runnerRefreshed.getInfo().getStatus().getRunningStatus()); + assertEquals("The number of personal bests for this runner is incorrect.", 2, runnerRefreshed.getPersonalBests().size()); assertTrue("Distance (map key) conversion did not work.", runnerRefreshed.getPersonalBests().keySet().contains("10K")); assertTrue("Distance (map key) conversion did not work.", runnerRefreshed.getPersonalBests().keySet().contains("5K")); assertTrue("Time (map value) conversion did not work.", runnerRefreshed.getPersonalBests().values().contains("47:34.0")); @@ -173,10 +174,10 @@ public void testAnnotationConverters() { Race raceRefreshed = em.find(Race.class, race.getId()); Map organizers = raceRefreshed.getOrganizers(); assertFalse("No race organizers returned.", organizers.isEmpty()); - assertTrue("More than one race organizer returned.", organizers.size() == 1); + assertEquals("More than one race organizer returned.", 1, organizers.size()); Responsibility resp = organizers.keySet().iterator().next(); - assertTrue("Responsibility was not uppercased by the converter", resp.getDescription().equals("RAISE FUNDS")); + assertEquals("Responsibility was not uppercased by the converter", "RAISE FUNDS", resp.getDescription()); for (String accomplishment : runnerRefreshed.getAccomplishments().keySet()) { assertTrue("Accomplishment (map key) conversion did not work.", accomplishment.endsWith("!!!")); @@ -323,10 +324,10 @@ public void testConvertOnElementCollection() { String dbCompetitionConverted = converter.convertToEntityAttribute(competition); assertFalse("Entity and database values shall not match.", competition.equals(entityVictory.getCompetition())); - assertTrue("Manually converted entity value and plain database value shall match.", - competition.equals(entityCompetitionConverted)); - assertTrue("Manually converted database value and plain entity value shall match.", - entityVictory.getCompetition().equals(dbCompetitionConverted)); + assertEquals("Manually converted entity value and plain database value shall match.", + entityCompetitionConverted, competition); + assertEquals("Manually converted database value and plain entity value shall match.", + dbCompetitionConverted, entityVictory.getCompetition()); } } for (Runner runner : runners) { @@ -346,8 +347,8 @@ public void testConvertOnElementCollection() { // Converter is missing so only entity to database conversion check makes sense. String entityCompetitionConverted = converter.convertToDatabaseColumn(entityVictory.getCompetition()); - assertTrue("Entity and database values shall match.", - competition.equals(entityVictory.getCompetition())); + assertEquals("Entity and database values shall match.", + entityVictory.getCompetition(), competition); assertFalse("Manually converted entity value and plain database value shall not match.", competition.equals(entityCompetitionConverted)); } diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/CriteriaQueryCastTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/CriteriaQueryCastTestSuite.java index 676fa14ada8..48d2f1e548d 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/CriteriaQueryCastTestSuite.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/CriteriaQueryCastTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -20,6 +21,7 @@ import java.util.List; import javax.persistence.EntityManager; +import javax.persistence.PersistenceUnitUtil; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Join; @@ -31,11 +33,11 @@ import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator; -import org.eclipse.persistence.testing.models.jpa.advanced.Employee; -import org.eclipse.persistence.testing.models.jpa.advanced.LargeProject; -import org.eclipse.persistence.testing.models.jpa.advanced.Project; -import org.eclipse.persistence.testing.models.jpa.advanced.SmallProject; +import org.eclipse.persistence.testing.models.jpa22.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa22.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa22.advanced.LargeProject; +import org.eclipse.persistence.testing.models.jpa22.advanced.Project; +import org.eclipse.persistence.testing.models.jpa22.advanced.SmallProject; import org.eclipse.persistence.testing.models.jpa.inheritance.Boat; import org.eclipse.persistence.testing.models.jpa.inheritance.Bus; import org.eclipse.persistence.testing.models.jpa.inheritance.Car; @@ -153,7 +155,7 @@ public void testDowncastOneToManyLeafQueryKey(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned, expected 1 but returned "+resultList.size(), resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -209,7 +211,7 @@ public void testDowncastOneToManyMidHierarchyQueryKey(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -263,7 +265,7 @@ public void testDowncastManyToManyQueryKey(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -314,7 +316,7 @@ public void testDowncastOneToManyLeafExpressionBuilder(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -370,7 +372,7 @@ public void testDowncastOneToManyMidHierarchyExpressionBuilder(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -423,7 +425,7 @@ public void testDowncastManyToManyExpressionBuilder(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -459,7 +461,7 @@ public void testDowncastInSelect(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -518,7 +520,7 @@ public void testDowncastSingleTableQueryKey(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -569,7 +571,7 @@ public void testDoubleDowncastOneToManyLeafQueryKey(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -621,7 +623,7 @@ public void testDoubleDowncastSeparateClass(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -684,7 +686,7 @@ public void testDowncastRelationshipTraversal(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -733,7 +735,7 @@ public void testDoubleDowncastOneToOne(){ cq.where(qb.or(qb.equal(s.get("maxSpeed"), 200), qb.equal(j.get("percentRust"), 20))); List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -785,8 +787,8 @@ public void testSelectCast(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect result size returned", resultList.size() == 1); - assertTrue("Incorrect results returned", (Double)resultList.get(0) == 1000); + assertEquals("Incorrect result size returned", 1, resultList.size()); + assertEquals("Incorrect results returned", 1000, (Double)resultList.get(0)); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -816,7 +818,7 @@ public void testCastInSubselect(){ proj.addTeamMember(emp); emp.addProject(lp); lp.addTeamMember(emp); - emp.setSalary(10000); + emp.setSalary(10000L); em.persist(emp); emp = new Employee(); @@ -825,7 +827,7 @@ public void testCastInSubselect(){ emp.addProject(lp); lp.addTeamMember(emp); em.persist(emp); - emp.setSalary(100); + emp.setSalary(100L); em.flush(); clearCache(); @@ -843,7 +845,7 @@ public void testCastInSubselect(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect result size returned", resultList.size() == 1); + assertEquals("Incorrect result size returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -889,8 +891,9 @@ public void testDowncastWithFetchJoin(){ List resultList = em.createQuery(cq).getResultList(); Person person = (Person)resultList.get(0); - assertTrue("Incorrect result size returned", resultList.size() == 1); - assertNotNull("The car was not fetched.", person.car); + assertEquals("Incorrect result size returned", 1, resultList.size()); + PersistenceUnitUtil unitUtil = em.getEntityManagerFactory().getPersistenceUnitUtil(); + assertTrue("The car was not fetched.", unitUtil.isLoaded(person, "car")); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -935,7 +938,7 @@ public void testDoubleTreatOnRoot(){ cq.where(qb.or(qb.equal( qb.treat(root, SportsCar.class).get("maxSpeed"), 200), qb.equal( qb.treat(root, Jalopy.class).get("percentRust"), 20))); List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -975,7 +978,7 @@ public void testDoubleTreatOnRootSTI(){ cq.where(qb.or(qb.equal( qb.treat(root, PerformanceTireInfo.class).get("speedRating"), 110), qb.equal( qb.treat(root, PassengerPerformanceTireInfo.class).get("speedRating"), 120))); List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -1026,7 +1029,7 @@ public void testTreatInFrom(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -1073,7 +1076,7 @@ public void testTreatInFromSTI(){ cq.select(b.get("speedRating")); List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -1123,7 +1126,7 @@ public void testTreatInWhere(){ List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -1170,7 +1173,7 @@ public void testTreatInWhereSTI(){ cq.where(qb.greaterThan(qb.treat(root.get("tires"), PerformanceTireInfo.class).get("speedRating"), 100)); List resultList = em.createQuery(cq).getResultList(); - assertTrue("Incorrect results returned", resultList.size() == 2); + assertEquals("Incorrect results returned", 2, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); @@ -1339,7 +1342,7 @@ public void testTreatUsingJoinOverDowncastRelationship(){ for (Object result: resultList) { assertTrue("query did not return intances of Company, instead it returned :"+result, (result instanceof Person)); } - assertTrue("Incorrect results returned", resultList.size() == 1); + assertEquals("Incorrect results returned", 1, resultList.size()); } finally { if (this.isTransactionActive(em)){ rollbackTransaction(em); diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/QueryTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/QueryTestSuite.java index afba3b3a468..928e345fa35 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/QueryTestSuite.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/advanced/QueryTestSuite.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -93,7 +94,7 @@ public void testQueryParameterPositional(){ } - TypedQuery typedQuery = em.createQuery("SELECT employee FROM Employee employee WHERE employee.firstName = ?1 OR employee.lastName = ?2", Employee.class)/*.setParameter(1, "Bob").setParameter(2, "Way")*/; + TypedQuery typedQuery = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = ?1 OR e.lastName = ?2", Employee.class)/*.setParameter(1, "Bob").setParameter(2, "Way")*/; i = 0; ArrayList params = new ArrayList(typedQuery.getParameters()); for (Parameter parameter: params){ diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/metadata/MetadataASMFactoryTest.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/metadata/MetadataASMFactoryTest.java index 50d4b092f80..88eaf871b9b 100644 --- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/metadata/MetadataASMFactoryTest.java +++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa22/metadata/MetadataASMFactoryTest.java @@ -25,7 +25,6 @@ import org.eclipse.samples.annotations.CycleA; import org.eclipse.samples.annotations.CycleB; import org.eclipse.samples.annotations.CycleSelf; -import org.junit.Assert; import junit.framework.Test; import junit.framework.TestSuite; @@ -52,12 +51,12 @@ public void testMetadataAnnotations() { MetadataAsmFactory fact = new MetadataAsmFactory(new MetadataLogger(null), MetadataASMFactoryTest.class.getClassLoader()); MetadataClass metadataClass = fact.getMetadataClass(Employee.class.getName()); MetadataAnnotation annotation = metadataClass.getAnnotation("javax.persistence.Entity"); - Assert.assertNotNull(annotation); - Assert.assertTrue(PersistenceUnitProcessor.isEntity(metadataClass)); - Assert.assertNotNull(PersistenceUnitProcessor.getEntityAnnotation(metadataClass)); + assertNotNull(annotation); + assertTrue(PersistenceUnitProcessor.isEntity(metadataClass)); + assertNotNull(PersistenceUnitProcessor.getEntityAnnotation(metadataClass)); annotation = metadataClass.getAnnotation("javax.persistence.EntityListeners"); - Assert.assertNotNull(annotation); + assertNotNull(annotation); } /** diff --git a/jpa/org.eclipse.persistence.jpa.jpql.test/src/org/eclipse/persistence/jpa/tests/jpql/parser/ArithmeticExpressionTest.java b/jpa/org.eclipse.persistence.jpa.jpql.test/src/org/eclipse/persistence/jpa/tests/jpql/parser/ArithmeticExpressionTest.java index 70efe0ad1e6..df8c6d0781b 100644 --- a/jpa/org.eclipse.persistence.jpa.jpql.test/src/org/eclipse/persistence/jpa/tests/jpql/parser/ArithmeticExpressionTest.java +++ b/jpa/org.eclipse.persistence.jpa.jpql.test/src/org/eclipse/persistence/jpa/tests/jpql/parser/ArithmeticExpressionTest.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -85,14 +86,14 @@ public void testOrderOfOperations_02() { @Test public void testOrderOfOperations_03() { - String query = "SELECT OBJECT(emp) FROM Employee emp WHERE emp.salary + 10000 - 10000 / ?1 * ?2 >= 50000"; + String query = "SELECT OBJECT(e) FROM Employee e WHERE e.salary + 10000 - 10000 / ?1 * ?2 >= 50000"; // (emp.salary) + ((10000) - ((10000 / ?1) * (?2)))) ExpressionTester selectStatement = selectStatement( - select(object("emp")), - from("Employee", "emp"), + select(object("e")), + from("Employee", "e"), where( - path("emp.salary") + path("e.salary") .add( numeric(10000) .subtract( diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/querydef/FromImpl.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/querydef/FromImpl.java index 0d91afce4ee..0fd59fe6ab6 100644 --- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/querydef/FromImpl.java +++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/querydef/FromImpl.java @@ -145,19 +145,19 @@ public Fetch fetch(SingularAttribute assoc){ * @return the resulting fetch join */ @Override - public Fetch fetch(SingularAttribute assoc, JoinType jt){ - if (((SingularAttribute)assoc).getType().getPersistenceType().equals(PersistenceType.BASIC)){ + public Fetch fetch(SingularAttribute assoc, JoinType jt) { + if (((SingularAttribute)assoc).getType().getPersistenceType().equals(PersistenceType.BASIC)) { throw new IllegalStateException(ExceptionLocalization.buildMessage("CAN_NOT_JOIN_TO_BASIC")); } Class clazz = assoc.getBindableJavaType(); Fetch join = null; ObjectExpression exp = ((ObjectExpression)this.currentNode).newDerivedExpressionNamed(assoc.getName()); if (jt.equals(JoinType.LEFT)){ - exp.doUseOuterJoin(); - }else if(jt.equals(JoinType.RIGHT)){ + exp.setShouldUseOuterJoin(true); + } else if (jt.equals(JoinType.RIGHT)) { throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED")); - }else{ - exp.doNotUseOuterJoin(); + } else { + exp.setShouldUseOuterJoin(false); } join = new JoinImpl(this, this.metamodel.managedType(clazz), this.metamodel, clazz, exp, assoc, jt); this.fetches.add(join); @@ -365,18 +365,18 @@ public Join join(SingularAttribute attribute) { @Override public Join join(SingularAttribute attribute, JoinType jt) { - if (((SingularAttribute)attribute).getType().getPersistenceType().equals(PersistenceType.BASIC)){ + if (((SingularAttribute)attribute).getType().getPersistenceType().equals(PersistenceType.BASIC)) { throw new IllegalStateException(ExceptionLocalization.buildMessage("CAN_NOT_JOIN_TO_BASIC")); } Class clazz = attribute.getBindableJavaType(); Join join = null; ObjectExpression exp = ((ObjectExpression)this.currentNode).newDerivedExpressionNamed(attribute.getName()); - if (jt.equals(JoinType.LEFT)){ - exp.doUseOuterJoin(); - }else if(jt.equals(JoinType.RIGHT)){ + if (jt.equals(JoinType.LEFT)) { + exp.setShouldUseOuterJoin(true); + } else if(jt.equals(JoinType.RIGHT)) { throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED")); - }else{ - exp.doNotUseOuterJoin(); + } else { + exp.setShouldUseOuterJoin(false); } join = new JoinImpl(this, this.metamodel.managedType(clazz), this.metamodel, clazz, exp, attribute, jt); this.joins.add(join);