You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Laurent ROCHE <la...@yahoo.com> on 2007/01/19 18:58:47 UTC
Tr : Still annoyed with identity
Tom,
Have you received this ?
Any news ?
Have fun,
L@u
The Computing Froggy
----- Message transféré ----
De : Laurent ROCHE <la...@yahoo.com>
À : tomdzk@gmail.com
Envoyé le : Mercredi, 17 Janvier 2007, 16h53mn 17s
Objet : Still annoyed with identity
Hi Tom,
As you were kind enough to look at my problem last time, I am mailing you with another test case.
I thought the identity problem was solved (because the data went in), but the data are still inserted with a generated ID no matter what value I set useexplicitidentityvalues to.
You will see after running the Ant task that the company ID are not identical to the ones in data.xml
Find included data_test.xml and shcema_test.xml.
And here is the ant task I use:
<target name="import-test" description="Creates db and loads data">
<taskdef name="ddlToDatabase"
classname="org.apache.ddlutils.task.DdlToDatabaseTask">
<classpath refid="classpath"/>
</taskdef>
<ddlToDatabase schemaFile="schema_test.xml">
<database url="jdbc:derby:test_db"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
username=""
password=""/>
<createDatabase failonerror="true"/>
<writeSchemaToDatabase/>
<writeDataToDatabase datafile="data_test.xml" useexplicitidentityvalues ="true"/>
</ddlToDatabase>
</target>
Have fun,
L@u
The Computing Froggy
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database";>
<database name="fims">
<table name="app_roles">
<column name="role_id" primaryKey="true" required="true" type="SMALLINT" size="2" autoIncrement="true"/>
<column name="role_name" primaryKey="false" required="true" type="VARCHAR" size="20" autoIncrement="false"/>
<column name="description" primaryKey="false" required="false" type="VARCHAR" size="64" autoIncrement="false"/>
<unique name="role_pkey">
<unique-column name="role_id"/>
</unique>
</table>
<table name="companies" description="At the moment, the only companies listed here are (M)akers or (S)uppliers (see company_type for more info).">
<column name="company_id" primaryKey="true" required="true" type="INTEGER" size="4" autoIncrement="true"/>
<column name="state_cd" primaryKey="false" required="false" type="CHAR" size="3" autoIncrement="false"/>
<column name="country_cd" primaryKey="false" required="true" type="CHAR" size="2" autoIncrement="false"/>
<column name="company_nm" primaryKey="false" required="true" type="VARCHAR" size="120" autoIncrement="false"/>
<column name="company_snm" primaryKey="false" required="true" type="VARCHAR" size="40" autoIncrement="false"/>
<column name="company_type" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false" description="indicates whether this is a Maker or a Supplier (see cdomains)"/>
<column name="address_lig1" primaryKey="false" required="true" type="VARCHAR" size="80" autoIncrement="false"/>
<column name="address_lig2" primaryKey="false" required="false" type="VARCHAR" size="80" autoIncrement="false"/>
<column name="address_lig3" primaryKey="false" required="false" type="VARCHAR" size="80" autoIncrement="false"/>
<column name="zip_code" primaryKey="false" required="true" type="VARCHAR" size="10" autoIncrement="false"/>
<column name="telephone" primaryKey="false" required="false" type="VARCHAR" size="35" autoIncrement="false"/>
<column name="fax" primaryKey="false" required="false" type="VARCHAR" size="35" autoIncrement="false"/>
<column name="web_site" primaryKey="false" required="false" type="VARCHAR" size="80" autoIncrement="false"/>
<column name="notes" primaryKey="false" required="false" type="VARCHAR" size="32500" autoIncrement="false"/>
<column name="town" primaryKey="false" required="true" type="VARCHAR" size="80" autoIncrement="false"/>
<unique name="companies_pk">
<unique-column name="company_id"/>
</unique>
<index name="companies_fkindex1">
<index-column name="country_cd"/>
<index-column name="state_cd"/>
</index>
<index name="fki_countries__states_for_countries__fk">
<index-column name="state_cd"/>
<index-column name="country_cd"/>
</index>
</table>
</database>
<?xml version='1.0' encoding='UTF-8'?>
<data>
<companies company_id="9" state_cd="WA " country_cd="US" company_nm="ZF Marine Electronics, LLC" company_snm="ZF USA" company_type="S" address_lig1=" 12125 Harbour Reach Drive," address_lig2=" Suite B" zip_code="98275 " telephone=" +1 425 583 1900" fax=" +1 425 493 1569" web_site="zf-marine.com" notes=" Email: 	 info.controls@zf.com" town=" Mukilteo" />
<companies company_id="3" country_cd="DE" company_nm=" MTU Friedrichshafen GmbH " company_snm="MTU GmbH" company_type="M" address_lig1="-" zip_code=" D - 88040" telephone="+49 7541 90-0" fax="+49 7541 90-2724" web_site="www.mtu-online.com" town="Friedrichshafen" />
<companies company_id="5" country_cd="FR" company_nm="MTU France SAS" company_snm="MTU SAS" company_type="S" address_lig1="281, chaussée Jules César" zip_code="95250 " telephone="+33 1 34 18 60 60" fax="+33 1 34 18 60 61" web_site="www.mtu-online.fr" notes="Christian.Courcelles@mtu-online.com 
extra Tel. +33 6 03 53 33 04" town="BEAUCHAMP " />
<companies company_id="6" country_cd="IT" company_nm="ZF Padova SpA" company_snm="ZF SpA" company_type="M" address_lig1=" Via Penghe 48, " address_lig2=" Caselle di Selvazzano, " zip_code=" I-35030 " telephone=" +39 049 8299-311" fax=" +39 049 8299-550" web_site="zf-marine.com" town="Padova" />
<companies company_id="11" country_cd="IT" company_nm="ZF Trimax SrL" company_snm="ZF SrL" company_type="M" address_lig1="Via Provinciale 73" zip_code=" 23841 " telephone=" +39 0341 57 53 06" fax=" +39 0341 57 53 49" web_site="zf-marine.com" notes=" Email: 	 info.zftrimax@zf.com
info.pleasurecraft@zf.com" town="Annone Brianza (Lc)" />
<companies company_id="12" country_cd="FR" company_nm="UPSA France" company_snm="UPSA Fr" company_type="M" address_lig1="1, La Canebière" zip_code="13015" town="MARSEILLE" />
<companies company_id="0" country_cd="--" company_nm="Undefined Company" company_snm="Undefined" company_type="M" address_lig1="N/A" zip_code="N/A" town="N/A" />
</data>
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
Re: Tr : Still annoyed with identity
Posted by Thomas Dudziak <to...@gmail.com>.
On 1/19/07, Laurent ROCHE <la...@yahoo.com> wrote:
> As you were kind enough to look at my problem last time, I am mailing you with another test case.
> I thought the identity problem was solved (because the data went in), but the data are still inserted with a generated ID no matter what value I set useexplicitidentityvalues to.
There was a small bug in the subtask itself that lead to the value for
useExplicitIdentityValues being ignored. I fixed this in SVN.
Tom