Permalink
Browse files

add DbInitConfigurator

1 parent d0da931 commit de99ecdcc4435001f3061b1191146e16095a99bb 三寻 committed Nov 13, 2016
Showing with 29 additions and 0 deletions.
  1. +29 −0 src/main/java/me/kafeitu/demo/activiti/activiti/DbInitConfigurator.java
@@ -0,0 +1,29 @@
+package me.kafeitu.demo.activiti.activiti;
+
+import org.activiti.engine.cfg.ProcessEngineConfigurator;
+import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
+import org.activiti.engine.impl.db.DbSqlSessionFactory;
+
+/**
+ * @author 三寻
+ * @version 1.0
+ * @date 16/8/19
+ */
+public class DbInitConfigurator implements ProcessEngineConfigurator {
+
+ @Override
+ public void beforeInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
+ DbSqlSessionFactory.databaseSpecificLimitAfterStatements.put("h2", "LIMIT #{firstResult},#{maxResults}");
+ DbSqlSessionFactory.databaseSpecificLimitAfterStatements.put("mysql", "LIMIT #{firstResult},#{maxResults}");
+ }
+
+ @Override
+ public void configure(ProcessEngineConfigurationImpl processEngineConfiguration) {
+
+ }
+
+ @Override
+ public int getPriority() {
+ return 0;
+ }
+}

0 comments on commit de99ecd

Please sign in to comment.