Advertisement
sombriks

applicationContext.xml spring + flyway + jersey + jpa

Jul 23rd, 2016
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.24 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3.  xmlns="http://www.springframework.org/schema/beans"
  4.  xmlns:context="http://www.springframework.org/schema/context"
  5.  xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  6.  xmlns:aop="http://www.springframework.org/schema/aop"
  7.  xmlns:jee="http://www.springframework.org/schema/jee"
  8.  xmlns:tx="http://www.springframework.org/schema/tx"
  9.  xmlns:p="http://www.springframework.org/schema/p"
  10.  xsi:schemaLocation="
  11.  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  12.  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  13.  http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
  14.  http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  15.  http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
  16.  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  17.  http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
  18.  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  19.  
  20.   <context:annotation-config />
  21.   <context:component-scan base-package="br.com.sinax" />
  22.  
  23.   <!-- uporte in-app para as migrações do esquema de banco -->
  24.   <jee:jndi-lookup jndi-name="jdbc/cadmusical-ds" id="dataSource" />
  25.   <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
  26.     <property name="dataSource" ref="dataSource"/>
  27.   </bean>
  28.  
  29.   <!-- JPA EntityManager injection support -->
  30.   <bean id="entityManagerFactory"
  31.    class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
  32.     <property name="persistenceUnitName" value="cadmusical-pu" />
  33.   </bean>
  34.   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  35.     <property name="entityManagerFactory" ref="entityManagerFactory" />
  36.   </bean>
  37.   <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  38.   <tx:annotation-driven />
  39.  
  40. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement