<?xml version='1.0' encoding='UTF-8'?> |
<!DOCTYPE hibernate-configuration PUBLIC |
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" |
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> |
<hibernate-configuration> |
<session-factory> |
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property> |
<property name="connection.driver_class">org.postgresql.Driver</property> |
<property name="connection.url">jdbc:postgresql://host:port/database</property> |
<property name="connection.username">username</property> |
<property name="connection.password">password</property> |
<property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property> |
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> |
<property name="current_session_context_class">thread</property> |
<property name="hibernate.show_sql">false</property> |
</session-factory> |
</hibernate-configuration> User.hbm.xml <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.network.newlens.test.entity.User" table="test_user"> <id name="id" column="id"> <generator class="increment"/> </id> <property name="name" column="name" /> <property name="birthday" column="birthday" /> </class> </hibernate-mapping> |
postgresql : hibernate.cfg.xml
最新推荐文章于 2019-07-30 11:50:29 发布