Purpose of running Torque from a jar

jarからTorqueを実行する目的

The standard practice for using Torque has been to download the jar, unjar it to get the directory structure given in the user guide, and somehow either integrate your source tree and Torque's un-jared directory structure. While doable, this was less than desirable, especially when working with prespecified directory structures, such as that used by Maven.

Torqueを使う標準の方法はjarファイルをダウンロードし、 jarを展開してユーザガイドにあるようなディレクトリ構成にし、どうにかして自分のソースツリーとTorqueのjarを解凍したディレクトリ構成を統合することです。しかし、特にMavenのようなあらかじめ特定されているディレクトリ構成とともに動かす場合は、これはあまり好ましくはありません。

Complex build scripts, such as Scarab's, which dynamically unjar Torque during the build process and copy over all the correct files, can get around this, but having to re-develop or even copy such capabilities on a project-by-project basis is undesirable do to the relative complexity.

Scarabのスクリプトのようなビルドの過程で動的にTorqueのjarを展開し、正しいファイルをすべてコピーするものは、 複雑なビルドスクリプトがこのことをうまく切り抜けています。 but having to re-develop or even copy such capabilities on a project-by-project basis is undesirable do to the relative complexity.

Instead, it is possible to run Torque without un-jaring it. All that is needed is the venerable build-torque.xml and build.properties. Everything else can be read from the classpath and outputted directly to the directories that are desired instead of the previous rigid structure.

その代わり、jarを展開せずにTorqueを実行することができます。 必要なものは、build-torque.xmlbuild.propertiesだけです。 他のものはすべてクラスパスから読むことができ、厳格な構成ではなく、望んだディレクトリに直接出力することができます。

Requirements

必要なこと

Along with the build-torque.xml and build.properties, you must ensure that Torque and all of it's dependencies are in the classpath. For a list of dependencies, please refer to dependencies.html .

build-torque.xmlbuild.propertiesに沿って、TorqueとTorqueが依存するものを確実にクラスパスに含まなければいけません。 依存するものの一覧には、dependencies.htmlを参照してください。

Along with the classpath, you must edit the build.properties and set a minimum set of variables:

クラスパスに沿って、build.propertiesを修正し、 最低限の変数セットを設定してください。

Note, if you set only the above properties, Torque will default to using the old directory structure to read and output files from. This maintains backwards compatibility, but is not always what is wanted. The next section addresses telling Torque where to read and output files.

注:上記のプロパティのみ設定したなら、Torqueはデフォルトで、ファイルを読んだり出力したりするために古いディレクトリ構成を使います。 これは下位互換を維持しますが、いつもそれが望まれるわけではありません。 次のセクションではTorqueにファイルを読んだり出力する場所を指定することについて書いています。

Configuring Directories

ディレクトリの設定

The following directory properties allow you to control with a good deal of granularity where Torque will read and output files. The table contains each of the properties, along with it's default value and description.

次のディレクトリプロパティによって、Torqueが読み書きするファイルの場所を適度な粒度でコントロールできるようになります。下表にはそれぞれのプロパティが、デフォルト値、説明と一緒にあります。

Property プロパティ Default デフォルト値 Description 説明
torque.home . Serves as the base directory when defining other default directories.
他のデフォルトディレクトリを定義する際のベースディレクトリとなります。
torque.output.dir ${torque.home}/src Serves as a general directory to output files to.
出力ファイルを置く標準のディレクトリとなります。
torque.schema.dir ${torque.home}/schema Where the *-schema.xml files are read from.
*-schema.xmlファイルを読み込む場所です。
torque.doc.dir ${torque.output.dir}/doc Where the schema documentation is output.
スキーマのドキュメントを出力する場所です。
torque.java.dir ${torque.output.dir}/java Where the java files are output.
javaファイルを出力する場所です。
torque.javadoc.dir ${torque.output.dir}/javadoc Where the javadoc files for the om classes are output.
omクラスのjavadocファイルを出力する場所です。
torque.ojb.dir ${torque.output.dir}/ojb Where the OJB files are output.
OJBファイルを出力する場所です。
torque.sql.dir ${torque.output.dir}/sql Where the SQL files are output.
SQLファイルを出力する場所です。