The configuration hibernate.cfg.xmlhibernate configuration file contains the basic information required to connect the persistence layer to the mapping file. Configuration file name defaults to hibernate.cfg.xml.hibernate.cfg.xml file configuration
<span style= "FONT-SIZE:18PX;" >< DTD information for!--configuration file--><! DOCTYPE hibernate-configuration Public "-//hibernate/hibernate configuration DTD 3.0//en" "Http://hibern Ate.sourceforge.net/hibernate-configuration-3.0.dtd "><!--Generated by MyEclipse hibernate Tools. -->< the root element of the!--configuration file-->
Hibernate mapping File Configuration (*.hbm.xml) the mapping between persisted classes of objects and relational databases through the. xml file configuration, typically namedPersistent class name. Hbm.xml, this file is typically placed under the same path as the persisted class object
*.hbm.xml file configuration (typically there are a number of persisted class objects that need to configure how many configuration files)Configuration example with User.hb,.xml file User.hbm.xml<span style= "FONT-SIZE:18PX;" >< DTD information for!--configuration file--><! DOCTYPE hibernate-mapping Public "-//hibernate/hibernate mapping DTD 3.0//en" "http://hibernate.sourceforge.net/ HIBERNATE-MAPPING-3.0.DTD "><!--mapping file autogenerated by MyEclipse persistence Tools-->
Profile extensions Hibernate.cfg.xml configuring C3P0 connection pooling<span style= "FONT-SIZE:18PX;" ><!--Set the maximum number of connections for the C3P0 connection pool--><property name= "Hibernate.c3p0.max_size" >50</property><!-- Set the minimum number of connections for the C3P0 connection pool--><property name= "Hibernate.c3p0.min_size" >1</property><!--Set the timeout length for connections in the C3P0 connection pool, Throws an exception when exceeded, in milliseconds--><property name= "Hibernate.c3p0.timeout" >1000</property><!-- Set the number of C3P0 cache statements--><property name= "Hibernate.c3p0.max_statements" >60</property></span >
For more C3P0 connection pool configurations, please refer to the properties file of Hibernate's etc sub-directory
*.hbm.xml---Collection mapping configuration set,map, List collection Configuration < collection class Map element >< collection foreign key ><j collection index field >< collection element/></Collection class mapping element >Hibernate learning Notes (2)---hibernate core file