* https://www.baeldung.com/the-persistence-layer-with-spring-and-jpa went into spring-jpa-2 * https://www.baeldung.com/hibernate-5-spring went to spring-jpa-2 * https://www.baeldung.com/transaction-configuration-with-jpa-and-spring went to spring-jpa-2 * https://www.baeldung.com/persistence-layer-with-spring-and-hibernate went to spring-jpa-2 * https://www.baeldung.com/simplifying-the-data-access-layer-with-spring-and-java-generics went to spring-jpa-2 * https://www.baeldung.com/the-persistence-layer-with-spring-data-jpa went to spring-data-jpa-repo-2 * https://www.baeldung.com/spring-data-jpa-query went to spring-data-jpa-query-2 * https://www.baeldung.com/spring-jdbc-jdbctemplate moved to spring-jdbc * Removed spring-persistence-simple module as all articles have been moved
30 lines
1.5 KiB
XML
30 lines
1.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<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"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
|
|
|
<context:property-placeholder location="classpath:persistence-h2.properties"/>
|
|
|
|
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
|
|
<property name="dataSource" ref="dataSource"/>
|
|
<property name="packagesToScan" value="com.baeldung.hibernate.bootstrap.model"/>
|
|
<property name="hibernateProperties">
|
|
<props>
|
|
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
|
|
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
|
|
</props>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp2.BasicDataSource">
|
|
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
|
<property name="url" value="${jdbc.url}"/>
|
|
<property name="username" value="${jdbc.user}"/>
|
|
<property name="password" value="${jdbc.pass}"/>
|
|
</bean>
|
|
|
|
<bean id="txManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
|
|
<property name="sessionFactory" ref="sessionFactory"/>
|
|
</bean>
|
|
</beans> |