Guest User

Untitled

a guest
Jul 30th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. Hibernate (JPA,JSF 2.0, Spring) switch from HyperSQL to Oracle - Configuration is being ignored
  2. <!-- Enable processing of @PersistenceContext and @PersistenceUnit -->
  3. <context:annotation-config/>
  4.  
  5. <!-- Enable transaction configuration with @Transactional -->
  6. <tx:annotation-driven transaction-manager="transactionManager"/>
  7.  
  8. <!-- Configure a c3p0 pooled data source -->
  9. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  10. <property name="user" value="user"/>
  11. <property name="password" value="password"/>
  12. <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
  13. <property name="jdbcUrl" value="jdbc:oracle:thin:@dburl"/>
  14. <property name="initialPoolSize" value="1"/>
  15. <property name="minPoolSize" value="1"/>
  16. <property name="maxPoolSize" value="10"/>
  17. </bean>
  18.  
  19. <!-- Configure the JPA entity manager factory with Hibernate -->
  20. <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  21. <property name="dataSource" ref="dataSource"/>
  22.  
  23. <property name="jpaVendorAdapter">
  24. <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  25. <property name="showSql" value="false"/>
  26. <property name="database" value="ORACLE"/>
  27. <property name="generateDdl" value="true"/>
  28. </bean>
  29. </property>
  30.  
  31. <property name="persistenceUnitName" value="mygourmet"/>
  32. </bean>
  33.  
  34. <!-- Configure transaction manager for JPA -->
  35. <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  36. <property name="entityManagerFactory" ref="entityManagerFactory"/>
  37. </bean>
  38.  
  39. <persistence-unit name="mygourmet" transaction-type="RESOURCE_LOCAL">
  40. <properties>
  41. <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
  42. <property name="hibernate.show_sql" value="false" />
  43. <property name="hibernate.format_sql" value="false" />
  44. <property name="hibernate.use_sql_comments" value="false" />
  45. <property name="hibernate.connection.autocommit" value="false" />
  46. <property name="hibernate.cache.use_query_cache" value="false" />
  47. <property name="hibernate.cache.use_second_level_cache" value="false" />
  48. <property name="hibernate.hbm2ddl.auto" value="create" />
  49. </properties>
Add Comment
Please, Sign In to add comment