src/org/openbravo/materialmgmt/InventoryCountProcess.java
changeset 34193 12232bee10ef
parent 33876 c5d8fbd7e953
child 34236 20cd44382a65
--- a/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Tue Jun 12 12:08:11 2018 +0000
+++ b/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Wed Jun 13 17:18:35 2018 +0200
@@ -24,7 +24,6 @@
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import javax.enterprise.inject.Any;
 import javax.enterprise.inject.Instance;
@@ -35,14 +34,7 @@
 import org.hibernate.Query;
 import org.hibernate.QueryTimeoutException;
 import org.hibernate.Session;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.function.SQLFunction;
-import org.hibernate.dialect.function.StandardSQLFunction;
 import org.hibernate.exception.GenericJDBCException;
-import org.hibernate.impl.SessionFactoryImpl;
-import org.hibernate.impl.SessionImpl;
-import org.hibernate.type.DateType;
-import org.hibernate.type.StringType;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.dal.core.OBContext;
@@ -174,23 +166,6 @@
     msg.setTitle(OBMessageUtils.messageBD("Success"));
     runChecks(inventory);
 
-    // In case get_uuid is not already registered, it's registered now.
-    final Dialect dialect = ((SessionFactoryImpl) ((SessionImpl) OBDal.getInstance().getSession())
-        .getSessionFactory()).getDialect();
-    Map<String, SQLFunction> function = dialect.getFunctions();
-    if (!function.containsKey("get_uuid")) {
-      dialect.getFunctions().put("get_uuid", new StandardSQLFunction("get_uuid", new StringType()));
-    }
-    if (!function.containsKey("now")) {
-      dialect.getFunctions().put("now", new StandardSQLFunction("now", new DateType()));
-    }
-    if (!function.containsKey("to_date")) {
-      dialect.getFunctions().put("to_date", new StandardSQLFunction("to_date", new DateType()));
-    }
-    if (!function.containsKey("to_timestamp")) {
-      dialect.getFunctions().put("to_timestamp",
-          new StandardSQLFunction("to_timestamp", new DateType()));
-    }
     StringBuffer insert = new StringBuffer();
     insert.append("insert into " + MaterialTransaction.ENTITY_NAME + "(");
     insert.append(" id ");