Author: stliu
Date: 2009-11-16 09:06:36 -0500 (Mon, 16 Nov 2009)
New Revision: 17990
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
Log:
JBPAPP-3067 HHH-4576 - Tests in MySQL using different case for objects as defined in
configuration
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16
14:05:17 UTC (rev 17989)
+++
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16
14:06:36 UTC (rev 17990)
@@ -186,7 +186,7 @@
List l = s.createQuery("from Vehicle").list();
assertEquals(l.size(),4);
- s.createSQLQuery( "insert into PICKUP (id, vin, owner) select id, vin, owner from
Car" ).executeUpdate();
+ s.createSQLQuery( "insert into Pickup (id, vin, owner) select id, vin, owner from
Car" ).executeUpdate();
l = s.createQuery("from Vehicle").list();
assertEquals(l.size(),5);
@@ -194,7 +194,7 @@
t.commit();
t = s.beginTransaction();
- s.createSQLQuery( "delete from TRUCK" ).executeUpdate();
+ s.createSQLQuery( "delete from Truck" ).executeUpdate();
l = s.createQuery("from Vehicle").list();
assertEquals(l.size(),4);
@@ -207,7 +207,7 @@
assertEquals(0,s.createSQLQuery( "delete from SUV where owner = :owner"
).setString( "owner", "NotThere" ).executeUpdate());
assertEquals(1,s.createSQLQuery( "delete from SUV where owner = :owner"
).setString( "owner", "Joe" ).executeUpdate());
- s.createSQLQuery( "delete from PICKUP" ).executeUpdate();
+ s.createSQLQuery( "delete from Pickup" ).executeUpdate();
l = s.createQuery("from Vehicle").list();
assertEquals(l.size(),0);
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16
14:05:17 UTC (rev 17989)
+++
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16
14:06:36 UTC (rev 17990)
@@ -26,6 +26,6 @@
<sql-query name="native-delete-car">
<synchronize table="Car"/>
- delete from CAR where owner = ?
+ delete from Car where owner = ?
</sql-query>
</hibernate-mapping>
\ No newline at end of file
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16
14:05:17 UTC (rev 17989)
+++
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16
14:06:36 UTC (rev 17990)
@@ -26,9 +26,9 @@
<!-- query-list name="currentEmployments"
query-ref="organizationCurrentEmployments"-->
<loader query-ref="organization"/>
- <sql-insert>INSERT INTO ORGANIZATION (NAME, ORGID) VALUES ( UPPER(?), ?
)</sql-insert>
- <sql-update>UPDATE ORGANIZATION SET NAME=UPPER(?) WHERE
ORGID=?</sql-update>
- <sql-delete>DELETE FROM ORGANIZATION WHERE ORGID=?</sql-delete>
+ <sql-insert>INSERT INTO Organization (NAME, ORGID) VALUES ( UPPER(?), ?
)</sql-insert>
+ <sql-update>UPDATE Organization SET NAME=UPPER(?) WHERE
ORGID=?</sql-update>
+ <sql-delete>DELETE FROM Organization WHERE ORGID=?</sql-delete>
</class>
<class name="Person">
@@ -37,9 +37,9 @@
</id>
<property name="name" not-null="true"/>
<loader query-ref="person"/>
- <sql-insert>INSERT INTO PERSON (NAME, PERID) VALUES ( UPPER(?), ?
)</sql-insert>
- <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE PERID=?</sql-update>
- <sql-delete>DELETE FROM PERSON WHERE PERID=?</sql-delete>
+ <sql-insert>INSERT INTO Person (NAME, PERID) VALUES ( UPPER(?), ?
)</sql-insert>
+ <sql-update>UPDATE Person SET NAME=UPPER(?) WHERE PERID=?</sql-update>
+ <sql-delete>DELETE FROM Person WHERE PERID=?</sql-delete>
</class>
<class name="Employment">
@@ -57,12 +57,12 @@
</property>
<loader query-ref="employment"/>
<sql-insert>
- INSERT INTO EMPLOYMENT
+ INSERT INTO Employment
(EMPLOYEE, EMPLOYER, STARTDATE, REGIONCODE, VALUE, CURRENCY, EMPID)
VALUES (?, ?, now(), UPPER(?), ?, ?, ?)
</sql-insert>
- <sql-update>UPDATE EMPLOYMENT SET ENDDATE=?, VALUE=?, CURRENCY=? WHERE
EMPID=?</sql-update>
- <sql-delete>DELETE FROM EMPLOYMENT WHERE EMPID=?</sql-delete>
+ <sql-update>UPDATE Employment SET ENDDATE=?, VALUE=?, CURRENCY=? WHERE
EMPID=?</sql-update>
+ <sql-delete>DELETE FROM Employment WHERE EMPID=?</sql-delete>
</class>
<resultset name="org-emp-regionCode">
@@ -86,8 +86,8 @@
<return alias="org" class="Organization"/>
<return-join alias="emp" property="org.employments"/>
SELECT {org.*}, {emp.*}
- FROM ORGANIZATION org
- LEFT OUTER JOIN EMPLOYMENT emp ON org.ORGID = emp.EMPLOYER
+ FROM Organization org
+ LEFT OUTER JOIN Employment emp ON org.ORGID = emp.EMPLOYER
WHERE org.ORGID=?
</sql-query>
@@ -102,8 +102,8 @@
<sql-query name="allOrganizationsWithEmployees"
flush-mode="never">
<return alias="org" class="Organization"/>
SELECT DISTINCT org.NAME AS {org.name}, org.ORGID AS {org.id}
- FROM ORGANIZATION org
- INNER JOIN EMPLOYMENT e ON e.EMPLOYER = org.ORGID
+ FROM Organization org
+ INNER JOIN Employment e ON e.EMPLOYER = org.ORGID
</sql-query>
<sql-query name="employment">
@@ -111,7 +111,7 @@
SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},
STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},
REGIONCODE as {emp.regionCode}, EMPID AS {emp.id}
- FROM EMPLOYMENT
+ FROM Employment
WHERE EMPID = ?
</sql-query>
@@ -119,7 +119,7 @@
<sql-query name="organizationEmployments">
<load-collection alias="empcol"
role="Organization.employments"/>
SELECT {empcol.*}
- FROM EMPLOYMENT empcol
+ FROM Employment empcol
WHERE EMPLOYER = :id
ORDER BY STARTDATE ASC, EMPLOYEE ASC
</sql-query>
@@ -140,7 +140,7 @@
SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},
STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},
REGIONCODE as {emp.regionCode}, EMPID AS {emp.id}, VALUE, CURRENCY
- FROM EMPLOYMENT
+ FROM Employment
WHERE EMPLOYER = :id AND ENDDATE IS NULL
ORDER BY STARTDATE ASC
</sql-query>
@@ -186,7 +186,7 @@
CREATE PROCEDURE selectAllEmployments ()
SELECT EMPLOYEE, EMPLOYER, STARTDATE, ENDDATE,
REGIONCODE, EMPID, VALUE, CURRENCY
- FROM EMPLOYMENT
+ FROM Employment
</create>
<drop>
DROP PROCEDURE selectAllEmployments