db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc BEGUIGNEAU <marc_beguign...@yahoo.fr>
Subject Primary key problem using postgresql and torque
Date Thu, 03 Jul 2003 16:19:38 GMT
Hello everyone,

I use postgresql 7.2.1 and Torque 3.0.

I have an existing db called si, with 2 tables. My
tables contain some datas.

I have generate the model using Torque and when every
goes rigth (select, delete and update) except when i
want to insert new data in my table. I have this error
from Torque:

org.apache.torque.TorqueException: IdGenerator for
table 'film' is null.

I have search the mailing list and try all the
solution I have found but nothing go rigth, i have all
the time the same error.

This is a copy of my shema file:

<code>

<?xml version="1.0"?>
<!DOCTYPE database SYSTEM
"d:/istia-si/web-inf/torque/database.dtd">

<database>
    <table name="film" idMethod="native">
        <column name="id_film" autoIncrement="true"
primaryKey="true" required="true" type="INTEGER"/>
        <column name="id_typefilm" required="true"
type="INTEGER"/>
        <column name="titre" size="50" type="CHAR"/>
        <column name="nbr_exemplaire" type="INTEGER"/>
        <column name="date_achat" type="DATE"/>
        <foreign-key foreignTable="type_film">
            <reference foreign="id_typefilm"
local="id_typefilm"/>
        </foreign-key>
        <id-method-parameter
value="film_id_film_seq"/>
    </table>
    <table name="type_film" idMethod="native">
        <column name="id_typefilm"
autoIncrement="true" required="true" 
primaryKey="true" type="INTEGER"/>
        <column name="type_film" size="50"
type="CHAR"/>
        <id-method-parameter
value="type_film_id_typefilm_seq"/>
    </table>
</database>

</code>

Before using posgresql, i was using Oracle 9i and
everything worked. I was using, for Oracle, the
idMethod="none" because i haved seqences and triggers
to generate my ids.

I have test all solutions I have found, on this
mailing list and on the mail-archive.com. 

I really don't see who is the problem!

If somebody have an idea to solve my problem? And if
somebody is in the same case?

Thank a lot in advance.

Regards

Marc BEGUIGNEAU


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com

Mime
View raw message