Advertisement
Javi

Ejemplo persistence.xml: Spring + Hibernate en escritorio

Dec 22nd, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.42 KB | None | 0 0
  1.  
  2. <persistence xmlns="http://java.sun.com/xml/ns/persistence"
  3.   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
  5.    http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
  6.   version="1.0">
  7.  
  8.     <persistence-unit name="data">
  9.         <properties>
  10.             <property name="hibernate.archive.autodetection" value="class, hbm"/>
  11.  
  12.         <!-- JDBC connection pool (use the built-in) -->
  13.             <property name="hibernate.connection.pool_size" value="1"/>
  14.  
  15.         <!-- SQL dialect -->
  16.             <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
  17.  
  18.         <!-- Enable Hibernate's automatic session context management -->
  19.             <property name="hibernate.current_session_context_class" value="thread"/>
  20.  
  21.         <!-- Disable the second-level cache  -->
  22.             <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
  23.  
  24.         <!-- Echo all executed SQL to stdout -->
  25.             <property name="hibernate.show_sql" value="true"/>
  26.             <property name="hibernate.format_sql" value="false"/>
  27.             <property name="hibernate.use_sql_comments" value="true"/>
  28.  
  29.  
  30.         <!-- Drop and re-create the database schema on startup -->
  31.             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  32.  
  33.         </properties>
  34.     </persistence-unit>
  35.  
  36. </persistence>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement