Hi!

I am a new user of Torque and have spent the last couple of days trying
to work my way through the tutorial.  By following it exactly, I cannot
get very far.  I can almost make it work, by doing by hand things the
tutorial claims are automatic, but am still getting an exception at
run-time - I assume due to the number of other problems I am having.  I
would love to know if anyone has successfully completed the tutorial as
written to maybe get an idea what I am doing wrong.  In the meantime, I
am submitting a list of problems that I had - hopefully to get some
insight into what is happening.

I am using mysql as a database.

Step 1: Obtaining the Torque Distribution
    - I have gone through the tutorial, from scratch, with the 2.1 and
the 3.0a5 binaries with similar results.

Step 2: Configuring Torque
    Build Properties
        "createDatabaseUrl" is listed as a setting in the
build.properties file that should be set to
"jdbc:mysql://127.0.0.1/mysql".
         This setting is not in the delivered build.properties file and
is not referenced or documented in the build.properties file.
          I added it to my build.properties file.

    Torque Database Schema
        The tutorial implies that two files live in the torque/schema
directory:  id-table-schema.xml and project-schema.xml.  The
project-schema.xml file is the only one delivered in the distribution.
I created the id-table-schema.xml file and populated it as described,
but had several problems with it later.

        When I tried to validate the two schema xml files against
http://jakarta.apache.org/turbine/dtd/database.dtd I got failure on the
"description" tag.  I copied the dtd to my machine and changed the path
in the xml file and it validated perfectly.  I'm sure this is my problem
but I haven't tracked it down yet.

    Torque Run-Time Properties
        The tutorial claims that there is a sample run-time properties
file (Torque.properties) in the torque/schema directory - there isn't.
        I created one as described in the tutorial.

Step 3: Invoking torque
    Generating the Object Model and Associated SQL
        The tutorial claims that when Ant is run it will pick up all
files in the torque/schema directory that end with -schema.xml and parse
them - this did not hold true for me.  I had to run Ant twice and change
the project name in the build.properties file to match the schema name
(this is how it is documented in the build.properties file but not in
the tutorial.

        After Ant ran, the sql generated did not contain sql to create
the database.  All of the table sql was there and correct.

    Creating the Database and Tables
        The tutorial says to run "ant project-create-db" to create the
database and "ant project-insert-sql" to build tables.
        These commands returned "Target 'project-create-db' does not
exist in this project." and "Target 'project-insert-sql' does not exist
in this project."
        I created the database by hand and ran the sql by hand to
generate the database and tables.

    Compiling and Running
        When I tried to compile the .java files generated by Torque, I
received a compile error because the id_table contained a column named
"TABLE_NAME" which conflicted with an internal variable also called
"TABLE_NAME".
        Also, I could not get the sample program, Bookstore.java, to
compile because it would not accept the "Torque.properties" parameter to
Torque.init().  I removed "Torque.properties" from Torque.init() but now
when it runs (until it crashes) it doesn't pick up the settings in the
"Torque.properties" file (obviously ;) ).

I get the feeling I am using out of date binaries but I can't find any
that are newer.  I have been reluctant to build from source but may try
that next.

Thanks,

Kevin Cottrell


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to