日期:2014-05-16 浏览次数:20439 次
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- 不知道为什么,把hibernate.dialect改成org.hibernate.dialect.MySQLInnoDBDialect,,如果你把表删除了的话,不能自动建表 但是运行的时候又得换成org.hibernate.dialect.MySQLInnoDBDialect才不会报错,,,纠结了。。 --> <!-- <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> --> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">root</property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.format_sql">true</property> <mapping resource="jbpm.repository.hbm.xml" /> <mapping resource="jbpm.execution.hbm.xml" /> <mapping resource="jbpm.history.hbm.xml" /> <mapping resource="jbpm.task.hbm.xml" /> <mapping resource="jbpm.identity.hbm.xml" /> </session-factory> </hibernate-configuration>
public static void main(String arg[]) { //必须使用的,流程引擎 ProcessEngine processEngine = Configuration.getProcessEngine(); RepositoryService repositoryService = processEngine .getRepositoryService(); }