On 1/9/07, Laurent ROCHE <[EMAIL PROTECTED]> wrote:

It is still not working properly i.e. not using ID from the data.
Here is the related extract of my bouild.xml file:
<target name="import-derby" description="Creates db and Loads data">
      <taskdef name="ddlToDatabase"
              classname="org.apache.ddlutils.task.DdlToDatabaseTask">
         <classpath refid="classpath"/>
      </taskdef>

      <ddlToDatabase schemaFile="schema-pg.xml" sortforeignkeys="false" verbosity="DEBUG" 
shutdowndatabase="true" >

         <database url="jdbc:derby:pip_dev"
                 driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
                 username=""
                 password=""/>

         <createDatabase failonerror="true"/>
         <writeSchemaToDatabase/>
        <writeDataToDatabase datafile="data.xml" failonerror="true" 
ensureforeignkeyorder="true" useexplicitidentityvalues ="true"/>

      </ddlToDatabase>

</target>

What do I do wrong ?

You have to set useexplicitidentityvalues to false, otherwise DdlUtils
will use the values defined in the data XML file, not the ones
generated by the database.

Tom

Reply via email to