Hibernate SVN: r17995 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-17 04:07:29 -0500 (Tue, 17 Nov 2009)
New Revision: 17995
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
JBPAPP-3056 Core - DB2 v9.1 - Test fails due to Invalid use of a parameter marker.
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-11-17 05:51:24 UTC (rev 17994)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-11-17 09:07:29 UTC (rev 17995)
@@ -128,7 +128,12 @@
assertEquals( 1, results.size() );
results = s.createQuery( "from Human where name is not null" ).list();
assertEquals( 3, results.size() );
- s.createQuery( "from Human where ? is null" ).setParameter( 0, null ).list();
+ String query =
+ getDialect() instanceof DB2Dialect ?
+ "from Human where cast(? as string) is null" :
+ "from Human where ? is null"
+ ;
+ s.createQuery( query ).setParameter( 0, null ).list();
s.getTransaction().commit();
s.close();
15 years
Hibernate SVN: r17994 - core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-17 00:51:24 -0500 (Tue, 17 Nov 2009)
New Revision: 17994
Modified:
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/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 17:02:54 UTC (rev 17993)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-17 05:51:24 UTC (rev 17994)
@@ -79,7 +79,7 @@
<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">
15 years
Hibernate SVN: r17993 - in search/trunk/src: main/java/org/hibernate/search/bridge and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-11-16 12:02:54 -0500 (Mon, 16 Nov 2009)
New Revision: 17993
Added:
search/trunk/src/main/java/org/hibernate/search/annotations/CalendarBridge.java
search/trunk/src/main/java/org/hibernate/search/bridge/builtin/CalendarBridge.java
search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateResolutionUtil.java
Modified:
search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java
search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateBridge.java
search/trunk/src/test/java/org/hibernate/search/test/bridge/BridgeTest.java
search/trunk/src/test/java/org/hibernate/search/test/bridge/Cloud.java
Log:
HSEARCH-328 Add a builtin bridge for Calendar @CalendarBridge (Amin Mohammed-Coleman)
Added: search/trunk/src/main/java/org/hibernate/search/annotations/CalendarBridge.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/annotations/CalendarBridge.java (rev 0)
+++ search/trunk/src/main/java/org/hibernate/search/annotations/CalendarBridge.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -0,0 +1,17 @@
+package org.hibernate.search.annotations;
+
+import java.lang.annotation.*;
+
+
+/**
+ * Defines the temporal resolution of a given field
+ * Calendar are stored as String in GMT
+ *
+ * @author Amin Mohammed-Coleman
+ */
+@Retention( RetentionPolicy.RUNTIME )
+@Target( {ElementType.FIELD, ElementType.METHOD} )
+@Documented
+public @interface CalendarBridge {
+ Resolution resolution();
+}
Modified: search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java 2009-11-16 14:52:30 UTC (rev 17992)
+++ search/trunk/src/main/java/org/hibernate/search/bridge/BridgeFactory.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -31,6 +31,7 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
+import java.util.Calendar;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
@@ -42,20 +43,21 @@
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.Resolution;
-import org.hibernate.search.bridge.builtin.BigDecimalBridge;
-import org.hibernate.search.bridge.builtin.BigIntegerBridge;
-import org.hibernate.search.bridge.builtin.BooleanBridge;
+import org.hibernate.search.bridge.builtin.StringBridge;
import org.hibernate.search.bridge.builtin.CharacterBridge;
-import org.hibernate.search.bridge.builtin.DateBridge;
import org.hibernate.search.bridge.builtin.DoubleBridge;
-import org.hibernate.search.bridge.builtin.EnumBridge;
import org.hibernate.search.bridge.builtin.FloatBridge;
+import org.hibernate.search.bridge.builtin.ShortBridge;
import org.hibernate.search.bridge.builtin.IntegerBridge;
import org.hibernate.search.bridge.builtin.LongBridge;
-import org.hibernate.search.bridge.builtin.ShortBridge;
-import org.hibernate.search.bridge.builtin.StringBridge;
+import org.hibernate.search.bridge.builtin.BigIntegerBridge;
+import org.hibernate.search.bridge.builtin.BigDecimalBridge;
+import org.hibernate.search.bridge.builtin.BooleanBridge;
+import org.hibernate.search.bridge.builtin.UrlBridge;
import org.hibernate.search.bridge.builtin.UriBridge;
-import org.hibernate.search.bridge.builtin.UrlBridge;
+import org.hibernate.search.bridge.builtin.DateBridge;
+import org.hibernate.search.bridge.builtin.CalendarBridge;
+import org.hibernate.search.bridge.builtin.EnumBridge;
/**
* This factory is responsible for creating and initializing build-in and custom <i>FieldBridges</i>.
@@ -101,9 +103,21 @@
public static final FieldBridge DATE_HOUR = new TwoWayString2FieldBridgeAdaptor( DateBridge.DATE_HOUR );
public static final FieldBridge DATE_MINUTE = new TwoWayString2FieldBridgeAdaptor( DateBridge.DATE_MINUTE );
public static final FieldBridge DATE_SECOND = new TwoWayString2FieldBridgeAdaptor( DateBridge.DATE_SECOND );
- public static final TwoWayFieldBridge DATE_MILLISECOND =
+
+ public static final FieldBridge CALENDAR_YEAR = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_YEAR );
+ public static final FieldBridge CALENDAR_MONTH = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_MONTH );
+ public static final FieldBridge CALENDAR_DAY = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_DAY );
+ public static final FieldBridge CALENDAR_HOUR = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_HOUR );
+ public static final FieldBridge CALENDAR_MINUTE = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_MINUTE );
+ public static final FieldBridge CALENDAR_SECOND = new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_SECOND );
+
+ public static final TwoWayFieldBridge DATE_MILLISECOND =
new TwoWayString2FieldBridgeAdaptor( DateBridge.DATE_MILLISECOND );
+ public static final TwoWayFieldBridge CALENDAR_MILLISECOND =
+ new TwoWayString2FieldBridgeAdaptor( CalendarBridge.CALENDAR_MILLISECOND );
+
+
static {
builtInBridges.put( Character.class.getName(), CHARACTER );
builtInBridges.put( char.class.getName(), CHARACTER );
@@ -127,6 +141,7 @@
builtInBridges.put( URI.class.getName(), Uri );
builtInBridges.put( Date.class.getName(), DATE_MILLISECOND );
+ builtInBridges.put( Calendar.class.getName(), CALENDAR_MILLISECOND);
}
/**
@@ -193,18 +208,21 @@
bridge = doExtractType( bridgeAnn, memberName );
}
else if ( member.isAnnotationPresent( org.hibernate.search.annotations.DateBridge.class ) ) {
- Resolution resolution =
- member.getAnnotation( org.hibernate.search.annotations.DateBridge.class ).resolution();
- bridge = getDateField( resolution );
+ Resolution resolution = member.getAnnotation( org.hibernate.search.annotations.DateBridge.class ).resolution();
+ bridge = getDateField( resolution );
}
+ else if ( member.isAnnotationPresent( org.hibernate.search.annotations.CalendarBridge.class ) ) {
+ Resolution resolution = member.getAnnotation( org.hibernate.search.annotations.CalendarBridge.class ).resolution();
+ bridge = getCalendarField( resolution );
+ }
else {
//find in built-ins
XClass returnType = member.getType();
bridge = builtInBridges.get( returnType.getName() );
if ( bridge == null && returnType.isEnum() ) {
- bridge = new TwoWayString2FieldBridgeAdaptor(
- new EnumBridge( reflectionManager.toClass( returnType ) )
- );
+ @SuppressWarnings( "unchecked" )
+ final Class<? extends Enum> enumClass = reflectionManager.toClass( returnType );
+ bridge = new TwoWayString2FieldBridgeAdaptor( new EnumBridge( enumClass ) );
}
}
//TODO add classname
@@ -272,6 +290,28 @@
}
}
+
+ public static FieldBridge getCalendarField(Resolution resolution) {
+ switch (resolution) {
+ case YEAR:
+ return CALENDAR_YEAR;
+ case MONTH:
+ return CALENDAR_MONTH;
+ case DAY:
+ return CALENDAR_DAY;
+ case HOUR:
+ return CALENDAR_HOUR;
+ case MINUTE:
+ return CALENDAR_MINUTE;
+ case SECOND:
+ return CALENDAR_SECOND;
+ case MILLISECOND:
+ return CALENDAR_MILLISECOND;
+ default:
+ throw new AssertionFailure( "Unknown Resolution: " + resolution );
+ }
+ }
+
/**
* Takes in a fieldBridge and will return you a TwoWayFieldBridge instance.
*
Added: search/trunk/src/main/java/org/hibernate/search/bridge/builtin/CalendarBridge.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/bridge/builtin/CalendarBridge.java (rev 0)
+++ search/trunk/src/main/java/org/hibernate/search/bridge/builtin/CalendarBridge.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -0,0 +1,73 @@
+package org.hibernate.search.bridge.builtin;
+
+import org.hibernate.search.annotations.Resolution;
+import org.hibernate.search.bridge.ParameterizedBridge;
+import org.hibernate.search.bridge.TwoWayStringBridge;
+import org.hibernate.util.StringHelper;
+import org.hibernate.AssertionFailure;
+import org.hibernate.HibernateException;
+import org.apache.lucene.document.DateTools;
+
+import java.util.Date;
+import java.util.Calendar;
+import java.util.Locale;
+import java.util.Map;
+import java.text.ParseException;
+
+
+public class CalendarBridge implements TwoWayStringBridge, ParameterizedBridge {
+
+ private DateTools.Resolution resolution;
+ public static final TwoWayStringBridge CALENDAR_YEAR = new CalendarBridge( Resolution.YEAR );
+ public static final TwoWayStringBridge CALENDAR_MONTH = new CalendarBridge( Resolution.MONTH );
+ public static final TwoWayStringBridge CALENDAR_DAY = new CalendarBridge( Resolution.DAY );
+ public static final TwoWayStringBridge CALENDAR_HOUR = new CalendarBridge( Resolution.HOUR );
+ public static final TwoWayStringBridge CALENDAR_MINUTE = new CalendarBridge( Resolution.MINUTE );
+ public static final TwoWayStringBridge CALENDAR_SECOND = new CalendarBridge( Resolution.SECOND );
+ public static final TwoWayStringBridge CALENDAR_MILLISECOND = new CalendarBridge( Resolution.MILLISECOND );
+
+
+ public CalendarBridge() {
+ }
+
+ public CalendarBridge(Resolution resolution) {
+ this.resolution = DateResolutionUtil.getLuceneResolution( resolution);
+ }
+
+ public void setParameterValues(Map parameters) {
+ Object resolution = parameters.get( "resolution" );
+ Resolution hibResolution;
+ if ( resolution instanceof String ) {
+ hibResolution = Resolution.valueOf( ( (String) resolution ).toUpperCase( Locale.ENGLISH ) );
+ }
+ else {
+ hibResolution = (Resolution) resolution;
+ }
+ resolution = DateResolutionUtil.getLuceneResolution( hibResolution );
+ }
+
+
+
+ public Object stringToObject(String stringValue) {
+ if ( StringHelper.isEmpty( stringValue )) {
+ return null;
+ }
+ try {
+ Date date = DateTools.stringToDate(stringValue);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(date);
+ return calendar;
+ } catch (ParseException e) {
+ throw new HibernateException( "Unable to parse into calendar: " + stringValue, e );
+ }
+ }
+
+ public String objectToString(Object object) {
+ if (object == null) {
+ return null;
+ }
+ Calendar calendar = (Calendar)object;
+ return DateTools.dateToString(calendar.getTime(),resolution);
+ }
+
+}
Modified: search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateBridge.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateBridge.java 2009-11-16 14:52:30 UTC (rev 17992)
+++ search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateBridge.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -69,7 +69,7 @@
}
public DateBridge(Resolution resolution) {
- setResolution( resolution );
+ this.resolution = DateResolutionUtil.getLuceneResolution(resolution);
}
public Object stringToObject(String stringValue) {
@@ -97,35 +97,8 @@
else {
hibResolution = (Resolution) resolution;
}
- setResolution( hibResolution );
+ this.resolution = DateResolutionUtil.getLuceneResolution(hibResolution );
}
- private void setResolution(Resolution hibResolution) {
- switch (hibResolution) {
- case YEAR:
- this.resolution = DateTools.Resolution.YEAR;
- break;
- case MONTH:
- this.resolution = DateTools.Resolution.MONTH;
- break;
- case DAY:
- this.resolution = DateTools.Resolution.DAY;
- break;
- case HOUR:
- this.resolution = DateTools.Resolution.HOUR;
- break;
- case MINUTE:
- this.resolution = DateTools.Resolution.MINUTE;
- break;
- case SECOND:
- this.resolution = DateTools.Resolution.SECOND;
- break;
- case MILLISECOND:
- this.resolution = DateTools.Resolution.MILLISECOND;
- break;
- default:
- throw new AssertionFailure( "Unknown Resolution: " + hibResolution );
-
- }
- }
+
}
Added: search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateResolutionUtil.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateResolutionUtil.java (rev 0)
+++ search/trunk/src/main/java/org/hibernate/search/bridge/builtin/DateResolutionUtil.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -0,0 +1,41 @@
+package org.hibernate.search.bridge.builtin;
+
+import org.apache.lucene.document.DateTools;
+import org.apache.lucene.document.DateTools.Resolution;
+import org.hibernate.AssertionFailure;
+
+public class DateResolutionUtil {
+
+ private DateResolutionUtil() {}
+
+
+ public static Resolution getLuceneResolution(org.hibernate.search.annotations.Resolution hibResolution) {
+ Resolution resolution = null;
+ switch (hibResolution) {
+ case YEAR:
+ resolution = DateTools.Resolution.YEAR;
+ break;
+ case MONTH:
+ resolution = DateTools.Resolution.MONTH;
+ break;
+ case DAY:
+ resolution = DateTools.Resolution.DAY;
+ break;
+ case HOUR:
+ resolution = DateTools.Resolution.HOUR;
+ break;
+ case MINUTE:
+ resolution = DateTools.Resolution.MINUTE;
+ break;
+ case SECOND:
+ resolution = DateTools.Resolution.SECOND;
+ break;
+ case MILLISECOND:
+ resolution = DateTools.Resolution.MILLISECOND;
+ break;
+ default:
+ throw new AssertionFailure( "Unknown Resolution: " + hibResolution );
+ }
+ return resolution;
+ }
+}
Modified: search/trunk/src/test/java/org/hibernate/search/test/bridge/BridgeTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/bridge/BridgeTest.java 2009-11-16 14:52:30 UTC (rev 17992)
+++ search/trunk/src/test/java/org/hibernate/search/test/bridge/BridgeTest.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -207,6 +207,55 @@
}
+
+ public void testCalendarBridge() throws Exception {
+ Cloud cloud = new Cloud();
+ Calendar c = GregorianCalendar.getInstance();
+ c.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); //for the sake of tests
+ c.set( 2000, 11, 15, 3, 43, 2 );
+ c.set( Calendar.MILLISECOND, 5 );
+
+
+ cloud.setMyCalendar(c); //5 millisecond
+ cloud.setCalendarDay(c);
+ cloud.setCalendarHour( c );
+ cloud.setCalendarMillisecond( c );
+ cloud.setCalendarMinute( c );
+ cloud.setCalendarMonth( c );
+ cloud.setCalendarSecond( c );
+ cloud.setCalendarYear( c );
+ org.hibernate.Session s = openSession();
+ Transaction tx = s.beginTransaction();
+ s.persist( cloud );
+ s.flush();
+ tx.commit();
+
+ tx = s.beginTransaction();
+ FullTextSession session = Search.getFullTextSession( s );
+ QueryParser parser = new QueryParser( "id", new StandardAnalyzer() );
+ Query query;
+ List result;
+
+ query = parser.parse(
+ "myCalendar:[19900101 TO 20060101]"
+ + " AND calendarDay:[20001214 TO 2000121501]"
+ + " AND calendarMonth:[200012 TO 20001201]"
+ + " AND calendarYear:[2000 TO 200001]"
+ + " AND calendarHour:[20001214 TO 2000121503]"
+ + " AND calendarMinute:[20001214 TO 200012150343]"
+ + " AND calendarSecond:[20001214 TO 20001215034302]"
+ + " AND calendarMillisecond:[20001214 TO 20001215034302005]"
+ );
+ result = session.createFullTextQuery( query ).list();
+ assertEquals( "Calendar not found or not property truncated", 1, result.size() );
+
+ s.delete( s.get( Cloud.class, cloud.getId() ) );
+ tx.commit();
+ s.close();
+
+ }
+
+
protected Class[] getMappings() {
return new Class[] {
Cloud.class
Modified: search/trunk/src/test/java/org/hibernate/search/test/bridge/Cloud.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/bridge/Cloud.java 2009-11-16 14:52:30 UTC (rev 17992)
+++ search/trunk/src/test/java/org/hibernate/search/test/bridge/Cloud.java 2009-11-16 17:02:54 UTC (rev 17993)
@@ -25,21 +25,14 @@
package org.hibernate.search.test.bridge;
import java.util.Date;
+import java.util.Calendar;
import java.net.URL;
import java.net.URI;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.hibernate.search.annotations.DateBridge;
-import org.hibernate.search.annotations.DocumentId;
-import org.hibernate.search.annotations.Field;
-import org.hibernate.search.annotations.FieldBridge;
-import org.hibernate.search.annotations.Index;
-import org.hibernate.search.annotations.Indexed;
-import org.hibernate.search.annotations.Parameter;
-import org.hibernate.search.annotations.Resolution;
-import org.hibernate.search.annotations.Store;
+import org.hibernate.search.annotations.*;
/**
* @author Emmanuel Bernard
@@ -74,7 +67,18 @@
private Class clazz;
private URL url;
private URI uri;
+ private Calendar myCalendar;
+ private Calendar calendarYear;
+ private Calendar calendarMonth;
+ private Calendar calendarDay;
+ private Calendar calendarMinute;
+ private Calendar calendarSecond;
+ private Calendar calendarHour;
+ private Calendar calendarMillisecond;
+
+
+
@Field(index=Index.UN_TOKENIZED, store=Store.YES)
public URL getUrl() {
return url;
@@ -328,4 +332,88 @@
public void setChar2(char char2) {
this.char2 = char2;
}
+
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ public Calendar getMyCalendar() {
+ return myCalendar;
+ }
+
+ public void setMyCalendar(Calendar myCalendar) {
+ this.myCalendar = myCalendar;
+ }
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge(resolution = Resolution.YEAR )
+ public Calendar getCalendarYear() {
+ return calendarYear;
+ }
+
+ public void setCalendarYear(Calendar calendarYear) {
+ this.calendarYear = calendarYear;
+ }
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.MONTH )
+ public Calendar getCalendarMonth() {
+ return calendarMonth;
+ }
+
+ public void setCalendarMonth(Calendar calendarMonth) {
+ this.calendarMonth = calendarMonth;
+ }
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.DAY )
+ public Calendar getCalendarDay() {
+ return calendarDay;
+ }
+
+ public void setCalendarDay(Calendar calendarDay) {
+ this.calendarDay = calendarDay;
+ }
+
+
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.MINUTE )
+ public Calendar getCalendarMinute() {
+ return calendarMinute;
+ }
+
+ public void setCalendarMinute(Calendar calendarMinute) {
+ this.calendarMinute = calendarMinute;
+ }
+
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.HOUR )
+ public Calendar getCalendarHour() {
+ return calendarHour;
+ }
+
+ public void setCalendarHour(Calendar calendarHour) {
+ this.calendarHour = calendarHour;
+ }
+
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.MILLISECOND )
+ public Calendar getCalendarMillisecond() {
+ return calendarMillisecond;
+ }
+
+ public void setCalendarMillisecond(Calendar calendarMillisecond) {
+ this.calendarMillisecond = calendarMillisecond;
+ }
+
+ @Field(index=Index.UN_TOKENIZED, store=Store.YES)
+ @CalendarBridge( resolution = Resolution.SECOND )
+ public Calendar getCalendarSecond() {
+ return calendarSecond;
+ }
+
+ public void setCalendarSecond(Calendar calendarSecond) {
+ this.calendarSecond = calendarSecond;
+ }
}
15 years
Hibernate SVN: r17992 - in core/trunk/annotations/src/test/java/org/hibernate/test/annotations: derivedidentities and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-11-16 09:52:30 -0500 (Mon, 16 Nov 2009)
New Revision: 17992
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Dependent.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/DependentId.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employee.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employer.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/EmployerId.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Person.java
Log:
HHH-4529 Added some test entities
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Dependent.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Dependent.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Dependent.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,57 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapsId;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Dependent {
+ @EmbeddedId
+ DependentId id; // id attribute mapped by join column default
+
+ @MapsId("empPK") // maps empPK attribute of embedded id
+ @ManyToOne
+ Employee employee;
+
+ public Dependent() {
+ }
+
+ public Dependent(DependentId id) {
+ this.id = id;
+ }
+
+ public Employee getEmployee() {
+ return employee;
+ }
+
+ public void setEmployee(Employee employee) {
+ this.employee = employee;
+ }
+
+ public DependentId getId() {
+ return id;
+ }
+}
+
+
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/DependentId.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/DependentId.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/DependentId.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,45 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Embeddable
+public class DependentId implements Serializable {
+ String name;
+
+ long empPK; // corresponds to PK type of Employee
+
+ public DependentId() {
+ }
+
+ public DependentId(long empPK, String name) {
+ this.empPK = empPK;
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
+
+
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employee.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employee.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employee.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,39 @@
+// $Id:$
+package org.hibernate.test.annotations.derivedidentities;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Employee {
+ @Id
+ @GeneratedValue
+ long id;
+
+ String name;
+
+ public Employee() {
+ }
+
+ public Employee( String name) {
+ this.name = name;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+}
+
+
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employer.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employer.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Employer.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,56 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.ManyToOne;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+(a)IdClass(EmployerId.class)
+public class Employer {
+ @Id
+ String name;
+
+ @Id
+ @ManyToOne
+ Employee employee;
+
+ public Employer() {
+ }
+
+ public Employer(String name) {
+ this.name = name;
+ }
+
+ public Employee getEmployee() {
+ return employee;
+ }
+
+ public void setEmployee(Employee emp) {
+ this.employee = emp;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/EmployerId.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/EmployerId.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/EmployerId.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,43 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import java.io.Serializable;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class EmployerId implements Serializable {
+ String name; // matches name of @Id attribute
+ long employee; // matches name of @Id attribute and type of Employee PK
+
+ public EmployerId() {
+ }
+
+ public EmployerId(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setEmployee(long employee) {
+ this.employee = employee;
+ }
+}
\ No newline at end of file
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,56 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.OneToOne;
+
+import org.hibernate.annotations.Entity;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class MedicalHistory {
+ @Id
+ @OneToOne
+ @JoinColumn(name="FK")
+ Person patient;
+
+ @Lob
+ byte[] xrayData;
+
+ private MedicalHistory() {
+ }
+
+ public MedicalHistory(Person patient) {
+ this.patient = patient;
+ }
+
+ public byte[] getXrayData() {
+ return xrayData;
+ }
+
+ public void setXrayData(byte[] xrayData) {
+ this.xrayData = xrayData;
+ }
+}
+
+
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Person.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Person.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/derivedidentities/Person.java 2009-11-16 14:52:30 UTC (rev 17992)
@@ -0,0 +1,43 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.derivedidentities;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Person {
+ @Id
+ private String ssn;
+
+ private Person() {
+ }
+
+ public Person(String ssn) {
+ this.ssn = ssn;
+ }
+
+ public String getSsn() {
+ return ssn;
+ }
+}
+
+
15 years
Hibernate SVN: r17991 - in core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test: sql/hand/custom/mysql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-16 09:12:38 -0500 (Mon, 16 Nov 2009)
New Revision: 17991
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml
core/branches/Branch_3_3/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/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 14:06:36 UTC (rev 17990)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 14:12:38 UTC (rev 17991)
@@ -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/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 14:06:36 UTC (rev 17990)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 14:12:38 UTC (rev 17991)
@@ -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/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16 14:06:36 UTC (rev 17990)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16 14:12:38 UTC (rev 17991)
@@ -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">
@@ -79,15 +79,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>
@@ -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
15 years
Hibernate SVN: r17990 - in core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test: sql/hand/custom/mysql and 1 other directory.
by hibernate-commits@lists.jboss.org
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
15 years
Hibernate SVN: r17989 - core/trunk/testsuite/src/test/java/org/hibernate/test/sql/hand/custom/mysql.
by hibernate-commits@lists.jboss.org
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
15 years
Hibernate SVN: r17988 - core/trunk/testsuite/src/test/java/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-16 09:04:16 -0500 (Mon, 16 Nov 2009)
New Revision: 17988
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.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/hql/BulkManipulationTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 13:50:49 UTC (rev 17987)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 14:04:16 UTC (rev 17988)
@@ -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/trunk/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 13:50:49 UTC (rev 17987)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 14:04:16 UTC (rev 17988)
@@ -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
15 years
Hibernate SVN: r17987 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/mysql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-16 08:50:49 -0500 (Mon, 16 Nov 2009)
New Revision: 17987
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/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_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16 13:50:05 UTC (rev 17986)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/sql/hand/custom/mysql/Mappings.hbm.xml 2009-11-16 13:50:49 UTC (rev 17987)
@@ -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">
@@ -79,15 +79,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>
@@ -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
15 years
Hibernate SVN: r17986 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-16 08:50:05 -0500 (Mon, 16 Nov 2009)
New Revision: 17986
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/Vehicle.hbm.xml
Log:
JBPAPP-3067 HHH-4576 - Tests in MySQL using different case for objects as defined in configuration
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 13:01:09 UTC (rev 17985)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java 2009-11-16 13:50:05 UTC (rev 17986)
@@ -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_2_4_SP1_CP/test/org/hibernate/test/hql/Vehicle.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 13:01:09 UTC (rev 17985)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/Vehicle.hbm.xml 2009-11-16 13:50:05 UTC (rev 17986)
@@ -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
15 years