See documentation ref. "I.6.1.2. The backend configuration"
1) Create your database (bellow are sample file for MYSQL)
Take care to disable hibernate schema generation (parameter hibernate.hbm2ddl.auto)
2) Init your database schema :
- launch mvn package
- extract "myproject-schema-mysql-innodb.sql" file from myproject/core/target/weather-core-1.0-SNAPSHOT-ddl-scripts.zip
- execute script on your new DB
3) Change your swing application launcher to avoid TestDataPersister execution :
Replace
-applicationClass fr.gefco.weather.startup.swing.development.SwingDevApplicationStartup
By
-applicationClass fr.gefco.weather.startup.swing.SwingApplicationStartup
That's all !
----------------------
Here is a sample config.xml file for MySQL :
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
default-lazy-init="true">
<!-- dataSource MySql localhost -->
<bean
id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property
name="driverClassName"
value="com.mysql.jdbc.Driver" />
<property
name="url"
value="jdbc:mysql://localhost:3306/myproject" />
<property
name="username"
value="root" />
<property
name="password"
value="rootpwd" />
</bean>
<!-- HIBERNATE MYSQL -->
<bean
id="hibernateSessionFactory"
parent="abstractHibernateSessionFactory">
<property
name="hibernateProperties">
<props>
<prop
key="hibernate.query.substitutions">true 1, false 0, yes 'Y', no 'N'</prop>
<prop
key="hibernate.dialect">org.jspresso.framework.model.persistence.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop
key="hibernate.order_updates">true</prop>
<prop
key="hibernate.max_fetch_depth">1</prop>
<prop
key="hibernate.default_batch_fetch_size">8</prop>
<prop
key="hibernate.jdbc.batch_versioned_data">true</prop>
<prop
key="hibernate.jdbc.use_streams_for_binary">true</prop>
<prop
key="hibernate.cache.region_prefix">hibernate.test</prop>
<prop
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
<!-- <prop
key="hibernate.hbm2ddl.auto">update</prop> -->
<prop
key="hibernate.jdbc.batch_size">0</prop>
</props>
</property>
<property
name="mappingLocations">
<list>
<value>classpath*:fr/gefco/myproject/**/*.hbm.xml</value>
</list>
</property>
</bean>
</beans>