Skip to content

Commit

Permalink
Hibernate default_schema is now taken from cadastrapp.properties
Browse files Browse the repository at this point in the history
Not fully working when georchestra.datadir is not set in the jvm.
No workaround found for the moment, you need to add georchestra.datadir
propreties in JVM launch for this to work.  So I comment the datadir
part


fixes #88
  • Loading branch information
pierrejego committed Nov 20, 2015
1 parent fd41367 commit 4ac5215
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cadastrapp/src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
<context:component-scan base-package="org.georchestra.cadastrapp" />
<tx:annotation-driven/>
<jpa:repositories base-package="org.georchestra.cadastrapp.repository" />

<!-- Only to load default_schema name in hibernate connection -->
<bean id="myPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>classpath:cadastrapp.properties</value>
<!-- <property name="ignoreUnresolvablePlaceholders" value="true" /> not working if ${georchestra.datadir} is not set -->
<!-- should be uncommented if use geOrchestra 15.12 and datadir -->
<!-- <value>file:${georchestra.datadir}/cadastrapp/cadastrapp.properties</value> -->
</list>
</property>
<property name="placeholderPrefix" value="${props:"/>
</bean>

<jaxrs:server id="services" address="/">
<jaxrs:serviceBeans>
Expand Down Expand Up @@ -68,8 +82,8 @@
<property name="jpaProperties">
<props>

<!-- schema -->
<prop key="hibernate.default_schema">cadastrapp_qgis</prop>
<!-- get schema name for cadastrapp.properties -->
<prop key="hibernate.default_schema">${props:schema.name}</prop>

<!-- dialect -->
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
Expand Down

0 comments on commit 4ac5215

Please sign in to comment.