Test case for issue 17058 Can't import products: No Dialect mapping for JDBC type
authorAdrián Romero <adrianromero@openbravo.com>
Mon, 09 May 2011 13:54:37 +0200
changeset 12068 cd6e4afe4afc
parent 12067 f3be3266eed1
child 12069 c3b8fa166f26
Test case for issue 17058 Can't import products: No Dialect mapping for JDBC type
src-test/org/openbravo/test/dal/IssuesTest.java
--- a/src-test/org/openbravo/test/dal/IssuesTest.java	Mon May 09 16:41:58 2011 +0200
+++ b/src-test/org/openbravo/test/dal/IssuesTest.java	Mon May 09 13:54:37 2011 +0200
@@ -32,6 +32,8 @@
 import org.apache.log4j.Logger;
 import org.dom4j.Document;
 import org.dom4j.io.SAXReader;
+import org.hibernate.SQLQuery;
+import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Reference;
@@ -599,4 +601,27 @@
 
     OBDal.getInstance().remove(hbLogRead);
   }
+
+  /**
+   * Testing issue 0017058. It verifies that the NVARCHAR JDBC type is properly mapped The test SQL
+   * query is used in the IDL module.
+   */
+  public void test17058() {
+
+    setSystemAdministratorContext();
+
+    final Session session = OBDal.getInstance().getSession();
+    SQLQuery query = session
+        .createSQLQuery("SELECT AD_REF_LIST.VALUE AS VALUE, AD_REF_LIST.NAME AS LISTNAME, TRL.NAME AS TRLNAME "
+            + "FROM AD_REF_LIST LEFT OUTER JOIN "
+            + "(SELECT AD_REF_LIST_ID, NAME FROM AD_REF_LIST_TRL WHERE AD_REF_LIST_TRL.AD_LANGUAGE = ?) TRL "
+            + "ON AD_REF_LIST.AD_REF_LIST_ID = TRL.AD_REF_LIST_ID "
+            + "WHERE AD_REF_LIST.AD_REFERENCE_ID = ?");
+    query.setString(0, "en_US");
+    query.setString(1, "800025");
+
+    java.util.List<Object[]> l = query.list();
+
+  }
+
 }
\ No newline at end of file