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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to