2014-02-14 18 views
1

我剛開始工作的活動,並在嵌入的方式整合它在我的項目(基於Postgres的)(樣本spring配置文件SNIP)Activiti BPM平臺 - 選擇一個特定的模式來創建表?

(...) 
    <!-- 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數據庫的'公共'架構中創建表。我寧願把這些表放在一個單獨的模式中,比如說'活動'。

事實是,瀏覽文檔/網絡近兩個小時後,我沒有找到任何方法來更改默認架構目標創建行爲。

任何幫助...非常感謝! ;)

+0

您可以嘗試:1)從[搜索路徑]中移除公共(http://www.postgresql.org/docs/current/static/ddl-schemas.html)2)創建新的模式「活動」3)添加模式「活動」來搜索路徑4)使用活動創建表(如果創建語句不符合模式限定且活動是搜索路徑中唯一模式,則應在活動模式中創建)。 5)將模式'public'添加回搜索路徑(如果activiti在沒有模式限定的情況下運行查詢/更新,那麼它應該可以工作)。 –

+1

Thomas是正確的,您需要將搜索路徑設置爲指向您要使用的模式。 –

回答

0

因爲Postgres 9.4 JDBC驅動程序,您可以指定JDBC URL這樣的默認模式: jdbc:postgresql://localhost:5432/mydatabase?currentSchema=myschema

有了這個URL,都在myschema架構中創建的,而不是默認的所有的Activiti表搜索路徑,通常爲public

來源:this response堆棧溢出和latest documentation