すでにPostgreSQLでMovableTypeを運用していたので、
+jdbcタスクでスキーマをゲット
+そのスキーマでJavaクラスを作成

という手順になりました。

具体的に変更したのは、build.propertiesの
 torque.project = movabletype
 torque.database.createUrl = jdbc:postgresql://127.0.0.1:5432/mt
 torque.database.buildUrl = jdbc:postgresql://127.0.0.1:5432/mt
 torque.database.url = jdbc:postgresql://127.0.0.1:5432/mt
 torque.database.driver = org.postgresql.Driver
 torque.database.user = mt
 torque.database.password =
 torque.database.host = 127.0.0.1
 (torque.targetPackage = org.apache.torque <-これもすべきか?)

ですね。んで、PostgreSQLサーバにログインして
 > ant -f build-torque.xml jdbc
てやると、./schema ディレクトリに schema.xml ができるので、それを[torque.projectの値]-schema.xml にmvして
てやると、./schema ディレクトリに schema.xml ができました((たぶん生成されるのはこのファイルのみでしょう))。~
それを[torque.projectの値]-schema.xml にmvして
 > ant -f build-torque.xml
としたら、Javaのソースファイルができました。
としたら、Javaのソースファイルができました。場所は
 ./src/java <-もともとsrcはないみたい。
です((srcディレクトリと上のschema.xml,velocity.logを消せば、元通りかな))。

 
***Eclipseで使用する
その際には
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
     <classpathentry kind="src" path="source"/>
     <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
     <classpathentry kind="lib" path="lib/commons-lang-1.0.1.jar"/>
     <classpathentry kind="lib" path="lib/torque-3.1.jar"/>
     <classpathentry kind="lib" path="lib/stratum-1.0-b3.jar"/>
     <classpathentry kind="lib" path="lib/village-2.0-dev-20030825.jar"/>
     <classpathentry kind="lib" path="lib/commons-logging-1.0.3.jar"/>
     <classpathentry kind="output" path="classes"/>
 </classpath>
のクラスパスが必要でした。

#navi()

SIZE(10){現在のアクセス:&counter;}


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS