Hibernate XML Configuration file


/ Published in: XML
Save to your folder(s)

Hibernate xml configuration file "hibernate.cfg.xml".


Copy this code and paste it in your HTML
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  4. "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  5.  
  6. <hibernate-configuration>
  7. <session-factory>
  8. <!-- SQL dialect -->
  9. <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
  10.  
  11. <!-- Database connection settings -->
  12. <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
  13. <property name="connection.url">jdbc:hsqldb:data/music</property>
  14. <property name="connection.username">sa</property>
  15. <property name="connection.password"></property>
  16. <property name="connection.shutdown">true</property>
  17.  
  18. <!-- JDBC connection pool (use the built-in one) -->
  19. <property name="connection.pool_size">1</property>
  20.  
  21. <!-- Enable Hibernate's automatic session context management -->
  22. <property name="current_session_context_class">thread</property>
  23.  
  24. <!-- Disable the second-level cache -->
  25. <property
  26. name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
  27.  
  28. <!-- disable batching so HSQLDB will propagate errors correctly. -->
  29. <property name="jdbc.batch_size">0</property>
  30.  
  31. <!-- Echo all executed SQL to stdout -->
  32. <property name="show_sql">true</property>
  33.  
  34. <!-- List all the mapping documents we're using -->
  35. <mapping resource="com/oreilly/hh/data/Track.hbm.xml"/>
  36. </session-factory>
  37. </hibernate-configuration>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.