我正在使用帶有休眠功能的嵌入式Derby數據庫。我正在將一些實體保存到數據庫中。關閉應用程序後,DB中沒有實體。爲什麼會這樣?Derby數據庫在應用程序運行後不保存實體
下面我Hibernate配置
<?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="show_sql">true</property>
<property name="format_sql">true</property>
<property name="dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
<property name="connection.url">jdbc:derby:\bases\localbase;create=true</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="hibernate.hbm2ddl.auto">validate</property>
<mapping class="com.example.model.HistoryItem"/>
<mapping class="com.example.model.User"/>
<mapping class="com.example.model.BaseAbstractEntity"/>
</session-factory>
</hibernate-configuration>
你如何寫入數據庫?你在犯嗎? – Mark 2010-08-15 09:04:55