TorqueとはデータベースにアクセスするためのAPIです。SQLレスで、さらにOracleやSybaseなど、どの製品を使っているかを意識しないで使用できるI/Fを備えています。 かっこよくいうと、O/Rマッピング・フレームワーク、というものでしょうか。
http://db.apache.org/builds/torque/release/3.1/ より
torque-3.1.tar.gz torque-gen-3.1.tar.gz
が取得可能です。
まず、アーカイブが3.1から2つに分かれました。
torque-3.1.tar.gz torque-gen-3.1.tar.gz
なのですが、コードジェネレータとランタイムの二つに分かれたようです。
インストールといった仰々しいものはありませんが、基本的に
だけです。
今回は、すでにPostgreSQLでMovableTypeを運用していたので、
という手順になりました。
具体的に変更したのは、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 <- mtはデータベース名 torque.database.driver = org.postgresql.Driver torque.database.user = mt torque.database.password = torque.database.host = 127.0.0.1 torque.targetPackage = kino.torque.movabletype
ですね。んで
> ant -f build-torque.xml jdbc
てやると、./schema ディレクトリに schema.xml ができました*1。
それを[torque.projectの値]-schema.xml にmvして
> ant -f build-torque.xml
としたら、Javaのソースファイルができました。場所は
./src/java <-もともとsrcはないみたい。
です*2。
この記事は
FrontPage
現在のアクセス:13520