Hibernateのサンプルコード

Hello world

Hibernate APIをつかったHello worldサンプルコードのディレクトリへ移動

$ cd jpwh-gettingstarted-070401/helloworld-native

HSQLDBをバックグラウンドで実行する

$ ant startdb &

DBを初期化(テーブルがすでにあったら消して作り直す)して、サンプルコードを実行する

$ ant schemaexport
$ ant run
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
Buildfile: /Your/Path/to/workspaces/HibernateLesson/data/hibernateInAction/jpwh-gettingstarted-070401/helloworld-native/build.xml

compile:
    [javac] /Your/Path/to/workspaces/HibernateLesson/data/hibernateInAction/jpwh-gettingstarted-070401/helloworld-native/build.xml:39: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

copymetafiles:

run:
     [java] Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
     [java] 1 message(s) found:
     [java] Hello World
     [java] 2 message(s) found:
     [java] Greetings Earthling
     [java] Take me to your leader (please)

BUILD SUCCESSFUL
Total time: 1 second