首页 > 代码库 > Hibernate 配置
Hibernate 配置
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//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:///hbsearch?useUnicode=true&characterEncoding=UTF8</property>
<property name="connection.username">root</property>
<property name="connection.password">xxx</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- SQL dialect -->
<property name="dialect">
org.hibernate.dialect.MySQL5InnoDBDialect
</property>
<!-- 扫描实体注解对象 -->
<property name="hibernate.search.default.directory_provider" >filesystem</property>
<property name="hibernate.search.default.indexBase">H:/hbsearch</property>
<mapping class="cz.pojo.Book"/>
<mapping class="cz.pojo.Author"/>
</session-factory>
</hibernate-configuration>
Hibernate 配置