Author: stliu
Date: 2009-11-16 09:05:17 -0500 (Mon, 16 Nov 2009)
New Revision: 17989
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
Log:
HHH-4576 - Tests in MySQL using different case for objects as defined in configuration
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16
14:04:16 UTC (rev 17988)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16
14:05:17 UTC (rev 17989)
@@ -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>
<class name="TextHolder">
@@ -72,12 +72,12 @@
<property name="description" type="text"
length="15000"/>
<loader query-ref="textholder"/>
<sql-insert>
- INSERT INTO TEXTHOLDER
+ INSERT INTO TextHolder
(DESCRIPTION, ID)
VALUES (?, ?)
</sql-insert>
- <sql-update>UPDATE TEXTHOLDER SET DESCRIPTION=? WHERE
ID=?</sql-update>
- <sql-delete>DELETE FROM TEXTHOLDER WHERE ID=?</sql-delete>
+ <sql-update>UPDATE TextHolder SET DESCRIPTION=? WHERE
ID=?</sql-update>
+ <sql-delete>DELETE FROM TextHolder WHERE ID=?</sql-delete>
</class>
<class name="ImageHolder">
@@ -87,12 +87,12 @@
<property name="photo" type="image"
length="15000"/>
<loader query-ref="imageholder"/>
<sql-insert>
- INSERT INTO IMAGEHOLDER
+ INSERT INTO ImageHolder
(PHOTO, ID)
VALUES (?, ?)
</sql-insert>
- <sql-update>UPDATE IMAGEHOLDER SET PHOTO=? WHERE ID=?</sql-update>
- <sql-delete>DELETE FROM IMAGEHOLDER WHERE ID=?</sql-delete>
+ <sql-update>UPDATE ImageHolder SET PHOTO=? WHERE ID=?</sql-update>
+ <sql-delete>DELETE FROM ImageHolder WHERE ID=?</sql-delete>
</class>
<resultset name="org-emp-regionCode">
@@ -109,15 +109,15 @@
<sql-query name="person">
<return alias="p" class="Person"
lock-mode="upgrade"/>
- SELECT NAME AS {p.name}, PERID AS {p.id} FROM PERSON WHERE PERID=? /*FOR UPDATE*/
+ SELECT NAME AS {p.name}, PERID AS {p.id} FROM Person WHERE PERID=? /*FOR UPDATE*/
</sql-query>
<sql-query name="organization">
<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>
@@ -132,8 +132,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">
@@ -141,7 +141,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>
@@ -149,7 +149,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>
@@ -170,7 +170,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>
@@ -213,12 +213,12 @@
<sql-query name="textholder">
<return alias="h" class="TextHolder"
lock-mode="upgrade"/>
- SELECT ID AS {h.id}, DESCRIPTION AS {h.description} FROM TEXTHOLDER WHERE ID=?
/*FOR UPDATE*/
+ SELECT ID AS {h.id}, DESCRIPTION AS {h.description} FROM TextHolder WHERE ID=?
/*FOR UPDATE*/
</sql-query>
<sql-query name="imageholder">
<return alias="h" class="ImageHolder"
lock-mode="upgrade"/>
- SELECT ID AS {h.id}, PHOTO AS {h.photo} FROM IMAGEHOLDER WHERE ID=? /*FOR
UPDATE*/
+ SELECT ID AS {h.id}, PHOTO AS {h.photo} FROM ImageHolder WHERE ID=? /*FOR
UPDATE*/
</sql-query>
<database-object>
@@ -226,7 +226,7 @@
CREATE PROCEDURE selectAllEmployments ()
SELECT EMPLOYEE, EMPLOYER, STARTDATE, ENDDATE,
REGIONCODE, EMPID, VALUE, CURRENCY
- FROM EMPLOYMENT
+ FROM Employment
</create>
<drop>
DROP PROCEDURE selectAllEmployments