db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andras Balogh <and...@reea.net>
Subject Re: Is this a Torque bug or a problem in my code?
Date Thu, 22 Jan 2004 09:44:02 GMT
        Hello Karl,

I don't know if  this will fix the problems you have but i think you 
need to set
 idMethod="none" for the  RestaurantInformation table definition in schema.
(since the primary key is a composite key)
After that you will ned to regenerate the classes.

Also i think you have to start a transaction,
than first call
info.save(conn);
and than
restaurant.save(conn);

These are just tips so maybe it won't fix your problem


Best wishes,
Andras.
p.s. I think your domain name is very interesting :)

Karl Stenerud wrote:

>Can someone please tell me if the following is a Torque bug or a problem in my code?
>
>I'm building a system that allows multilingual information for a restaurant.
>The Restaurant object can have RestaurantInformation objects associated with it.
>The RestaurantInformation object has a composite key made from a restaurant ID and a 2-character
language field (there are 2 columns with primaryKey="true").
>
>
>In my code, I fill out a new Restaurant object, then I fill out a new RestaurantInformation
object.
>Finally, I add the RestaurantInformation object to the Restaurant object and call save
on the Restaurant.
>At this point, I get an exception thrown from within BaseRestaurantInformation.
>The generated code at the point of exception looks like this:
>
>    public void setPrimaryKey(ObjectKey key) throws TorqueException
>    {
>        SimpleKey[] keys = (SimpleKey[]) key.getValue();    // <-- Line 650
>        SimpleKey tmpKey = null;
>                      setRestaurantNo(((NumberKey)keys[0]).intValue());
>                        setLanguage(keys[1].toString());
>              }
>
>
>
>  
>



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


Mime
View raw message