プロジェクトの作り始め

最初の準備

ディレクトリを作って、そこに$JOEY-GEN_HOME(Windows系なら%JOEY-GEN_HOME%)からbuild-joey.properties, build-joey.xml をプロジェクトのディレクトリにコピーしてください。

build-joey.propertiesを変更

joey-gen.proj.name = joey-gen_sample1

proj.maven.org.name = asyrinx.org
proj.maven.org.url = http://www.asyrinx.org
proj.maven.org.logo.url = http://www.asyrinx.org/logo1.gif
proj.maven.package = org.asyrinx.joey.gen.sample1

########
joey-gen.schema.debug = false
# joey-gen.templatePath = D:/dev/asyrinx.org/local/joey-gen/src/templates

joey-gen.addTimeStamp = true

joey-gen.db.type = firebird
joey-gen.db.jdbc.url = jdbc:firebirdsql://localhost:3050/D:/job/techno/workspace/tz3/db/firebird/TZ3.GDB
joey-gen.db.jdbc.driver = org.firebirdsql.jdbc.FBDriver
joey-gen.db.jdbc.username = SYSDBA
joey-gen.db.jdbc.password = masterkey

# joey-gen.db.type = hsql
# joey-gen.db.jdbc.url = jdbc:hsqldb:hsql://localhost/
# joey-gen.db.jdbc.driver = org.hsqldb.jdbcDriver
# joey-gen.db.jdbc.username = sa
# joey-gen.db.jdbc.password =

# joey-gen.entity.base.prefix = Base
# joey-gen.entity.base.suffix = 
# joey-gen.dao.prefix = 
# joey-gen.dao.suffix = Dao

joey-gen.proj.name と、maven関係のproj.maven.*を適当に設定してください。
DBがすでに使える状態であれば、joey-gen.db.*も適当にやっちゃってください。

とりあえずスキーマを作る

プロジェクトのディレクトリに"schema"というサブディレクトリを作成。
で、そこにスキーマ定義ファイルを作成します。名前はXXX-schema.xmlとなっているといいでしょう。http://d.hatena.ne.jp/akm/20041129 のサンプルでも使ってやってください。

コマンド実行

コマンドプロンプトからカレントディレクトリで以下を実行。

maven genapp
ant -f build-joey.xml maven

eclipseを使っている場合は、これでクラスパスなどが設定されます。

maven eclipse

実行後にEclipse上でrefreshしてください。あ[Preference]-[Java]-[Build Path]-[Classpath Variables]で、MAVEN_REPOを登録しておいてください。Windowsなら"C:\Documents and Settings\(ユーザ名)\.maven\repository"という感じです。