[prev in list] [next in list] [prev in thread] [next in thread] 

List:       turbine-torque-user
Subject:    RE: Using generator directly from Java ?
From:       "svallet" <svallet () t-systems ! fr>
Date:       2003-04-29 16:13:43
[Download RAW message or body]

Ok, I found an answer in the archives... wanted to do the things too fast

So I do the following :

set some properties
[...]
torqueSQLTask.initControlContext();
torqueSQLTask.execute();
torqueSQLTask.getDataModels().clear();

It works fine, but when I look at the generated SQL, the tables are
generated twice
for example :

--- begin generated file ---

# -----------------------------------------------------------------------
# ADOPTION
# -----------------------------------------------------------------------
drop table if exists ADOPTION;

CREATE TABLE ADOPTION
(
        ID_ADOPTION INTEGER NOT NULL AUTO_INCREMENT,
        ID_PARENT INTEGER,
        TABLE_PARENT VARCHAR (16),
        ID_ENFANT INTEGER NOT NULL,
        TABLE_ENFANT VARCHAR (16) NOT NULL,
    PRIMARY KEY(ID_ADOPTION)
);


# -----------------------------------------------------------------------
# ADOPTION
# -----------------------------------------------------------------------
drop table if exists ADOPTION;

CREATE TABLE ADOPTION
(
        ID_ADOPTION INTEGER NOT NULL AUTO_INCREMENT,
        ID_PARENT INTEGER,
        TABLE_PARENT VARCHAR (16),
        ID_ENFANT INTEGER NOT NULL,
        TABLE_ENFANT VARCHAR (16) NOT NULL,
    PRIMARY KEY(ID_ADOPTION)
);

--- end generated file ---

The schema is here :
&lt;?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?&gt;
&lt;!DOCTYPE database SYSTEM "database.dtd"&gt;

<database name="catgen2" defaultIdMethod="idbroker">

<table name="ADOPTION" skipSql="false">
<column name="ID_ADOPTION" type="INTEGER" required="true"
autoIncrement="true" primaryKey="true"/>
<column name="ID_PARENT" type="INTEGER" required="false"/>
<column name="TABLE_PARENT" type="VARCHAR" size="16" required="false"/>
<column name="ID_ENFANT" type="INTEGER" required="true"/>
<column name="TABLE_ENFANT" type="VARCHAR" size="16" required="true"/>
</table>

</database>

I didn't notice this when running Torque/ant from the command-line.
Is it possible that using it directly from a Java Class causes this ?
I wonder what I may have done wrong...

Thanks for any suggestions,
Simon


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic