IDEA自动配置hibernate
我的xml配置文件:
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost:3306/xiaonei</property> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="connection.profile"> hspmysql </property> <property name="hibernate.bytecode.use_reflection_optimizer">false</property> <property name="hibernate.connection.pool_size">5</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.generate_statistics">true</property> <property name="hibernate.jdbc.batch_versioned_data">true</property> <property name="hibernate.max_fetch_depth">5</property> <property name="hibernate.service.allow_crawling">false</property> <property name="hibernate.show_sql">true</property>
</session-factory> </hibernate-configuration>
右击:
点击ok等待几分钟idea会自动创建完成