1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/tx
     http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
     http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  <tx:annotation-driven transaction-manager="transactionManager" mode="proxy" proxy-target-class="true"/>

  <context:annotation-config />

  <bean id="jpaDialect"
    class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />

  <bean id="jpaVendorAdapter"
    class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
    <property name="showSql" value="true" /> 
    <property name="generateDdl" value="true" />  
    <property name="databasePlatform" value="org.eclipse.persistence.platform.database.PostgreSQLPlatform" />
  </bean>

  <bean id="loadTimeWeaver"
    class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver" />

  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="org.postgresql.Driver"/>
        <property name="url" value="jdbc:postgresql://192.168.0.10:5432/ti_fiscal"/>
        <property name="username" value="postgres"/>
        <property name="password" value="admin"/>
    </bean>

  <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
    <property name="dataSource" ref="dataSource" />
    <property name="persistenceUnitName" value="Fiscal" />
    <property name="persistenceXmlLocation" value="osgibundle:META-INF/persistence.xml" />
    <property name="jpaDialect" ref="jpaDialect" />
    <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
    <property name="loadTimeWeaver" ref="loadTimeWeaver"/>
  </bean>

  <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
  </bean>

  <bean id="jpaDao" class="br.com.germantech.repo.JPADao"/>

  <bean id="springApplicationContext" class="br.com.germantech.util.ApplicationContextUtils" />
</beans>