Skip to content

Instantly share code, notes, and snippets.

@vojkny
Created February 25, 2014 14:57
Show Gist options
  • Save vojkny/9210398 to your computer and use it in GitHub Desktop.
Save vojkny/9210398 to your computer and use it in GitHub Desktop.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<context:annotation-config/>
<context:spring-configured/>
<context:property-placeholder
ignore-resource-not-found="true"
location="/WEB-INF/application.properties,file:///etc/goout,file:///apps/goout-webapp/conf/application.properties"/>
<context:component-scan base-package="cz.goout"/>
<tx:annotation-driven transaction-manager="transactionManager"/><!-- mode="aspectj"-->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="persistenceUnit"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">${database.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">${database.structure}</prop>
<prop key="hibernate.connection.url">${database.connection}</prop>
<prop key="hibernate.connection.username">${database.username}</prop>
<prop key="hibernate.connection.password">${database.password}</prop>
<prop key="hibernate.connection.driver_class">${database.driver}</prop>
<prop key="hibernate.connection.shutdown">true</prop>
<prop key="hibernate.connection.writedelay">0</prop>
<prop key="hibernate.connection.characterEncoding">UTF-8</prop>
<prop key="hibernate.connection.charSet">UTF-8</prop>
<prop key="hibernate.show_sql">${database.show_sql}</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.ejb.metamodel.generation">disabled</prop>
<!-- Use the C3P0 connection pool provider-->
<prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">30</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
<prop key="hibernate.c3p0.max_statements">50</prop>
<prop key="hibernate.c3p0.idle_test_period">600</prop>
<!-- hikari
<prop key="hibernate.connection.provider_class">com.zaxxer.hikari.hibernate.HikariConnectionProvider</prop>
<prop key="hibernate.hikari.minimumPoolSize">20</prop>
<prop key="hibernate.hikari.maximumPoolSize">100</prop>
<prop key="hibernate.hikari.idleTimeout">30000</prop>
<prop key="hibernate.hikari.dataSourceClassName">com.mysql.jdbc.jdbc2.optional.MysqlDataSource</prop>
<prop key="hibernate.hikari.dataSource.url">${database.connection}</prop>
<prop key="hibernate.hikari.dataSource.user">${database.username}</prop>
<prop key="hibernate.hikari.dataSource.password">${database.password}</prop>
-->
</props>
</property>
</bean>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="htmlCompiler" class="org.maite.compiler.compilers.HTMLCompiler"/>
<bean id="em" class="org.maite.persistence.EntityManager"/>
<bean id="cachingService" class="org.maite.caching.FileCachingService" autowire="byName"/>
<bean id="freemarkerService" class="org.maite.mvc.FreemarkerService"/>
<!-- router -->
<bean id="router" class="org.maite.mvc.controller.router.Router"/>
<!-- counter -->
<bean class="cz.goout.tracker.Tracker"/>
<!-- static resources pseudo controller -->
<bean id="resourceController" class="org.maite.mvc.controller.ResourceController">
<property name="resourcesDirectory" value="${directory.resources}"/>
</bean>
<!-- freemarker view resolver -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="viewNames" value="*" />
<property name="cache" value="false"/>
<property name="prefix" value=""/>
<property name="suffix" value=".ftl"/>
<property name="exposeSpringMacroHelpers" value="false"/>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment