我刚刚开始使用activity,并以嵌入式方式(示例spring配置文件片段)将其集成到我的项目(基于postgres)中。
(...)
<!-- Activiti components -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
(...)它工作得很好,并且在启动时在我的应用程序模式上创建了很多表。
我的问题是:表是在我的postgres数据库的'public‘模式中创建的。我更喜欢将这些表放在一个单独的模式中,比如“activity”。
事实上,在浏览了几乎两个小时的文档/网络之后,我没有找到任何方法来更改默认的模式目标创建行为。
任何帮助..。非常感谢!;)
发布于 2017-07-07 23:13:40
由于Postgres 9.4 JDBC驱动程序,您可以在JDBC url中指定缺省模式,如下所示:jdbc:postgresql://localhost:5432/mydatabase?currentSchema=myschema
使用这个URL,所有Activiti表都是在myschema模式中创建的,而不是在搜索路径(通常是public )中创建的缺省表。
来源: Stack Overflow和latest documentation上的this response。
https://stackoverflow.com/questions/21780482
复制相似问题