Sponsered Links
Categories
Sponsered Links

Sample hibernate configuration file

 

In this example the following points highlighted

  • The document type declaration is used by the XML parser to validate this document against the Hibernate configuration DTD.
  • The optional name attribute is equivalent to the property hibernate.session_factory_name and used for JNDI binding of the SessionFactory, discussed in the next section.
  • Hibernate properties may be specified without the hibernate prefix. Property names and values are otherwise identical to programmatic configuration properties.
  • Mapping documents may be specified as application resources or even as hardcoded filenames.

?xml version='1.0'encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="java:/hibernate/HibernateFactory">
<property name="show_sql">true</property>
<property name="connection.datasource">
java:/comp/env/jdbc/AuctionDB
</property>
<property name="dialect">
net.sf.hibernate.dialect.PostgreSQLDialect
</property>
<property name="transaction.manager_lookup_class">
net.sf.hibernate.transaction.JBossTransactionManagerLookup
</property>
<mapping resource="auction/Item.hbm.xml"/>
<mapping resource="auction/Category.hbm.xml"/>
<mapping resource="auction/Bid.hbm.xml"/>
</session-factory>
</hibernate-configuration>

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved