db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinod_Thapliyal" <Vinod_Thapli...@infosys.com>
Subject RE: build successful but no table in the data base.
Date Mon, 10 Feb 2003 05:45:56 GMT
Thanks Peter,
It really helped.
I know that If we use the create db command for ant it will drop the existing tables. This
is why I am not using the command. I had used the Jetspeed source to deploy it as an application
on my tomcat server. I was successful at that. After this I tried to create one more table
by defining a schema for my table. I discovered two thing while trying to build and compile
the torque.

1. My schema had a foreign key to a table in Security-schema.xml. which contained the table
being referenced. While trying to build I got error. Failed to set foreign key on a non existent
table TURBINE_PROJECT(my table name). But, the table was manually created by me in the database
so it did exist. 
The solution I figured out is to place the schema  for my table in security-schema.xml only.


2. Secondly, while trying to compile the generated java files using the ant compile command
for the torque. I get the following error.


file:C:/jetsrc/build/torque/build-torque.xml:75: taskdef class org.apache.torque

.task.TorqueDataModelTask cannot be found

This despite including the torque jar file in the classpath.

What's the workaround for this problem?


The build process for Torque is a several step process:
1)  Generate the SQL to build the database
2)  Generate the OM classes for the database
3)  Create the database (either via ant or "run manually")

For step 3, there is an ant task that can create it - I don't know if
this works with Oracle or not.  In my case (Postgresql with some
Torque modifications), it does not.  Therefore, I create the database

"Manually" means that I take the generated SQL files and run them
myself.  In the case where I have an already existing database and I've
added a table, then I extract only the relevant "CREATE" scripts and
then run those.

Usually, in a production environment (ie, a database where tables
already exist with data in them), you don't want to use the automated
ant-task because it will drop the entire database and then recreate it. 
So I believe most Torque users end up doing the "manual" thing at some

Note that you don't want to write your own "create" statements - we're
not suggesting that you do things completely manually.  You should use
the SQL statements generated by Torque, but you need to run them

Hope this helps.

On Fri, 2003-02-07 at 07:54, Vinod_Thapliyal wrote:
> Even I ran the Sql scripts for the Jetspeed tables and populated the tables manually.
But, then I again created one new schema file for one more table. The build was successful
and all the OM classes (for the new table) were there. But, the table was not created. So,
does it mean that every time I want to create a table I need to manually create and populate
the tables and use the build only to generate OM classes?
> If this is the case then there is no need the sql files generated by torque during the
build process.
> Is it that I only need to copy the OM classes generated to my already existing OM classes
(including the map builder class for my table).
> -----Original Message-----
> From: Scott Eade [mailto:seade@backstagetech.com.au] 
> Sent: Friday, February 07, 2003 12:55 PM
> To: Torque Developers List
> Subject: Re: build successful but no table in the data base.
> I am reasonably sure that you have to create the database manually whenh
> using torque with oracle.
> HTH,
> Scott
> -- 
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
> .Mac Chat/AIM: seade at mac dot com
> On 7/02/2003 4:56 PM, "Vinod_Thapliyal" <Vinod_Thapliyal@infosys.com> wrote:
> > Hi,
> > 
> > I configured my torque.properties and build.properties to connect to my oracle
> > database. I created one more Schema file in the schema directory and named it
> > as tea-schema.xml. Now, since torque generates the om model for the files in
> > schema directory ending with "X-schema.xml". The peer classes for my table are
> > generated and my build for  the jetspeed is successful. My jetspeed is up and
> > running but when I try to access my Tea table from database using the Database
> > browser nothing happens. I looked into the databse there is no
> > table????????????????????
> > 
> > Where have I gone wrong????????
> > 
> > I hope there will be a reply to this query.................
> > 
> > Raghu
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-dev-help@db.apache.org
> > 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message