Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <persistence version="2.1"
  3. xmlns="http://xmlns.jcp.org/xml/ns/persistence"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
  6. http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd">
  7. <persistence-unit name="products-unit"
  8. transaction-type="RESOURCE_LOCAL">
  9. <!-- Per correttezza cambio il package uguale a quello che uso nel codice! -->
  10. <class>it.uniroma3.siw.products.Product</class>
  11. <properties>
  12. <property name="javax.persistence.jdbc.driver"
  13. value="org.postgresql.Driver" />
  14. <property name="javax.persistence.jdbc.user"
  15. value="postgres" />
  16. <property name="javax.persistence.jdbc.password"
  17. value="cristian" />
  18. <property name="javax.persistence.jdbc.url"
  19. value="jdbc:postgresql://localhost/products" />
  20. <!-- Hibernate properties -->
  21. <property name="hibernate.show_sql" value="true" />
  22. <property name="hibernate.format_sql" value="true" />
  23. <property name="hibernate.dialect"
  24. value="org.hibernate.dialect.PostgreSQLDialect" />
  25. <property name="hibernate.hbm2ddl.auto" value="create" />
  26. </properties>
  27. </persistence-unit>
  28.  
  29. <persistence-unit name="products-unit-test" transaction-type="RESOURCE_LOCAL">
  30. <class>it.uniroma3.siw.products.Product</class>
  31. <properties>
  32. <property name="hibernate.show_sql" value="true" />
  33. <property name="hibernate.format_sql" value="true" />
  34. <property name="hibernate.hbm2ddl.auto" value="create" />
  35. <property name="javax.persistence.jdbc.driver"
  36. value="org.h2.Driver" />
  37. <property name="javax.persistence.jdbc.url"
  38. value="jdbc:h2:mem:test?MODE=PostgreSQL" />
  39. <property name="javax.persistence.jdbc.user" value="postgres" />
  40. <property name="javax.persistence.jdbc.password" value="cristian" />
  41. <property name="hibernate.dialect"
  42. value="org.hibernate.dialect.H2Dialect" />
  43. </properties>
  44. </persistence-unit>
  45.  
  46. </persistence>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement