Author: steve.ebersole(a)jboss.com
Date: 2007-03-29 09:09:39 -0400 (Thu, 29 Mar 2007)
New Revision: 11362
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/sql/GeneralTest.java
Log:
test suite fixes : postgresql (alias casing)
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/sql/GeneralTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/sql/GeneralTest.java 2007-03-29
12:48:35 UTC (rev 11361)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/sql/GeneralTest.java 2007-03-29
13:09:39 UTC (rev 11362)
@@ -20,6 +20,7 @@
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
import org.hibernate.transform.DistinctRootEntityResultTransformer;
import org.hibernate.transform.Transformers;
+import org.hibernate.transform.AliasToEntityMapResultTransformer;
/**
* @author Steve Ebersole
@@ -472,7 +473,7 @@
Object[] o = (Object[]) list.get(0);
assertEquals(8, o.length);
- list =
s.createSQLQuery(getEmploymentSQL()).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).list();
+ list = s.createSQLQuery( getEmploymentSQL() ).setResultTransformer( new
UpperCasedAliasToEntityMapResultTransformer() ).list();
assertEquals(1, list.size());
m = (Map) list.get(0);
assertTrue(m.containsKey("EMPID"));
@@ -595,4 +596,13 @@
}
}
+ private static class UpperCasedAliasToEntityMapResultTransformer extends
AliasToEntityMapResultTransformer {
+ public Object transformTuple(Object[] tuple, String[] aliases) {
+ String[] ucAliases = new String[aliases.length];
+ for ( int i = 0; i < aliases.length; i++ ) {
+ ucAliases[i] = aliases[i].toUpperCase();
+ }
+ return super.transformTuple( tuple, ucAliases );
+ }
+ }
}
Show replies by date