diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/various/readwriteexpression/Staff.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/various/readwriteexpression/Staff.java index 1f1a5265fa..b58bac8c2b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/various/readwriteexpression/Staff.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/various/readwriteexpression/Staff.java @@ -52,24 +52,24 @@ public class Staff { @Column(name="size_in_cm") @ColumnTransformer( forColumn = "size_in_cm", - read = "size_in_cm / 2.54", - write = "? * 2.54" ) + read = "size_in_cm / 2.54E0", + write = "? * 2.54E0" ) public double getSizeInInches() { return sizeInInches; } public void setSizeInInches(double sizeInInches) { this.sizeInInches = sizeInInches; } private double sizeInInches; //Weird extra S to avoid potential SQL keywords @ColumnTransformer( - read = "radiusS / 2.54", - write = "? * 2.54" ) + read = "radiusS / 2.54E0", + write = "? * 2.54E0" ) public double getRadiusS() { return radiusS; } public void setRadiusS(double radiusS) { this.radiusS = radiusS; } private double radiusS; @Column(name="diamet") @ColumnTransformer( - read = "diamet / 2.54", - write = "? * 2.54" ) + read = "diamet / 2.54E0", + write = "? * 2.54E0" ) public double getDiameter() { return diameter; } public void setDiameter(double diameter) { this.diameter = diameter; } private double diameter; diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/basic/User.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/component/basic/User.hbm.xml index 85839a6956..255df21705 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/component/basic/User.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/component/basic/User.hbm.xml @@ -22,8 +22,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> + write="0.453E0 * ?" + read="weight_kg / 0.453E0"/> diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java index e88985e36e..a9fae2c83f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java @@ -307,7 +307,7 @@ public class ASTParserLoadingTest extends FunctionalTestCase { results = s.createQuery( "from Human where name is not null" ).list(); assertEquals( 3, results.size() ); String query = - getDialect() instanceof DB2Dialect ? + ( getDialect() instanceof DB2Dialect || getDialect() instanceof HSQLDialect ) ? "from Human where cast(? as string) is null" : "from Human where ? is null" ; @@ -2600,14 +2600,14 @@ public class ASTParserLoadingTest extends FunctionalTestCase { * PostgreSQL >= 8.3.7 typecasts are no longer automatically allowed * http://www.postgresql.org/docs/current/static/release-8-3.html */ - if(getDialect() instanceof PostgreSQLDialect){ + if(getDialect() instanceof PostgreSQLDialect || getDialect() instanceof HSQLDialect){ hql = "from Animal a where bit_length(str(a.bodyWeight)) = 24"; }else{ hql = "from Animal a where bit_length(a.bodyWeight) = 24"; } session.createQuery(hql).list(); - if(getDialect() instanceof PostgreSQLDialect){ + if(getDialect() instanceof PostgreSQLDialect || getDialect() instanceof HSQLDialect){ hql = "select bit_length(str(a.bodyWeight)) from Animal a"; }else{ hql = "select bit_length(a.bodyWeight) from Animal a"; diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/Animal.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/hql/Animal.hbm.xml index 94411be0db..71e693d348 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/Animal.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/Animal.hbm.xml @@ -50,8 +50,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> diff --git a/hibernate-core/src/test/java/org/hibernate/test/join/Person.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/join/Person.hbm.xml index bf9bf03ca1..227f1456ed 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/join/Person.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/join/Person.hbm.xml @@ -39,8 +39,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> @@ -73,8 +73,8 @@ + read="pwd_expiry_weeks * 7.0E0" + write="? / 7.0E0"/> diff --git a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/Person.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/Person.hbm.xml index bb60f51dd3..99845abb25 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/Person.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/Person.hbm.xml @@ -38,8 +38,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> @@ -58,8 +58,8 @@ + read="pwd_expiry_weeks * 7.0E0" + write="? / 7.0E0"/> diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java index c63b5391fa..390bd85459 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java @@ -1939,7 +1939,7 @@ public class FooBarTest extends LegacyTestCase { .addOrder( Order.asc("date") ) .list(); assertTrue( list.size()==1 && list.get(0)==f ); - if(!(getDialect() instanceof TimesTenDialect)) { + if(!(getDialect() instanceof TimesTenDialect || getDialect() instanceof HSQLDialect)) { list = s.createCriteria(Foo.class).setMaxResults(0).list(); assertTrue( list.size()==0 ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/subselect/Beings.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/subselect/Beings.hbm.xml index 10a8752058..adc3ebc2a7 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/subselect/Beings.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/subselect/Beings.hbm.xml @@ -39,8 +39,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> @@ -62,8 +62,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> @@ -92,7 +92,7 @@ + read="height_centimeters / 2.54E0"/> diff --git a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/Person.hbm.xml b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/Person.hbm.xml index dced315dae..bda7e18803 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/Person.hbm.xml +++ b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/Person.hbm.xml @@ -37,8 +37,8 @@ + read="height_centimeters / 2.54E0" + write="? * 2.54E0"/> @@ -56,8 +56,8 @@ + read="pwd_expiry_weeks * 7.0E0" + write="? / 7.0E0"/>