1)アプリケーションを教師に送信するとき、アプリケーションの最初の起動時に空のテーブルをいくつか作成し、サンプル データを入力するように指示するにはどうすればよいですか? ファイルなどにSQLスクリプトを含めることができることを知っています。hibrenate に空のテーブルを作成するように指示できますか? アプリケーションで使用するエンティティがあります。
2)IDE(NetNeans)が起動したら、サービスに移動してデータベース(JavaDB)を手動で起動します。そうしないと、アプリケーションの起動時に休止状態が接続できないと不平を言うからです。hibernate start に db (localhost:1527 上) を開始するように指示するにはどうすればよいですか?
私のhebernate.cfg:
<?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="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="hibernate.connection.url">jdbc:derby://localhost:1527/sample</property>
<property name="hibernate.connection.username">app</property>
<property name="hibernate.connection.password">app</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<mapping resource="entity/PurchaseOrder.hbm.xml"/>
<mapping resource="entity/Customer.hbm.xml"/>
<mapping resource="entity/ProductCode.hbm.xml"/>
<mapping resource="entity/Product.hbm.xml"/>
<mapping resource="entity/MicroMarket.hbm.xml"/>
<mapping resource="entity/Manufacturer.hbm.xml"/>
<mapping resource="entity/DiscountCode.hbm.xml"/>
</session-factory>
</hibernate-configuration>
私は英語の知識がなく、Googleでクエリを作成するのが難しい. それらの関数がどのように呼び出されたか教えてください (存在する場合)。
どんな助けでも大歓迎です。前もって感謝します。