You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by croniccoder <ch...@yahoo.com> on 2007/06/05 15:22:47 UTC

Update not working

I am trying to update a value in my database, and am using the code below.
But it doesn't update and I have absolutely NO reason why this isn't
working. The database it's updating has a primary key. I am getting an
instance of the database entry, then trying to update it with a new figure.

num.setValue(myString);       
num.save();

-- 
View this message in context: http://www.nabble.com/Update-not-working-tf3871748.html#a10969340
Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.


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


Re: Update not working

Posted by "barak@fetchbook.info" <ba...@fetchbook.info>.

Thomas Vandahl wrote:
> croniccoder wrote:
>   
>> No, its not in my schema with primary key. So that may be it, torque is not
>> recognizing the table with a primary key.
>>     
>
> In general, it is advisable to give Torque as much information as
> possible about your schema. Indices, primary and foreign keys should be
> available to the generator. This may give you features you might have
> missed.
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
>
>   

Re: Update not working

Posted by Thomas Vandahl <tv...@apache.org>.
croniccoder wrote:
> No, its not in my schema with primary key. So that may be it, torque is not
> recognizing the table with a primary key.

In general, it is advisable to give Torque as much information as
possible about your schema. Indices, primary and foreign keys should be
available to the generator. This may give you features you might have
missed.

Bye, Thomas.


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


RE: Update not working

Posted by croniccoder <ch...@yahoo.com>.
No, its not in my schema with primary key. So that may be it, torque is not
recognizing the table with a primary key.


Thomas Fischer-11 wrote:
> 
> 
> Does Torque know about the primary key ? I.e. in your schema, have you set
> the attribute primaryKey to "true" for your primare key column ?
> 
>    Regards
> 
>     Thomas
> 
> croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:44:44:
> 
>>
>> Thank you foor response. The table I am trying to update does have a
> primary
>> key. I seem to just be using basic torque code, and it isn't working, and
>> for the life of me, I can't figure out WHY!
>>
>>
>> Thomas Fischer-11 wrote:
>> >
>> > update is known not to work if your table has no primary key. This
> might
>> > be
>> > the cause of your problem.
>> >
>> > It is encouraged very strongly to use primary keys for all your tables.
>> >
>> >    Regards,
>> >
>> >       Thomas
>> > croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:22:47:
>> >
>> >>
>> >> I am trying to update a value in my database, and am using the code
>> > below.
>> >> But it doesn't update and I have absolutely NO reason why this isn't
>> >> working. The database it's updating has a primary key. I am getting an
>> >> instance of the database entry, then trying to update it with a new
>> > figure.
>> >>
>> >> num.setValue(myString);
>> >> num.save();
>> >>
>> >> --
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/Update-not-working-
>> tf3871748.html#a10969809
>> Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Update-not-working-tf3871748.html#a10971192
Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.


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


RE: Update not working

Posted by Thomas Fischer <fi...@seitenbau.net>.
Does Torque know about the primary key ? I.e. in your schema, have you set
the attribute primaryKey to "true" for your primare key column ?

   Regards

    Thomas

croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:44:44:

>
> Thank you foor response. The table I am trying to update does have a
primary
> key. I seem to just be using basic torque code, and it isn't working, and
> for the life of me, I can't figure out WHY!
>
>
> Thomas Fischer-11 wrote:
> >
> > update is known not to work if your table has no primary key. This
might
> > be
> > the cause of your problem.
> >
> > It is encouraged very strongly to use primary keys for all your tables.
> >
> >    Regards,
> >
> >       Thomas
> > croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:22:47:
> >
> >>
> >> I am trying to update a value in my database, and am using the code
> > below.
> >> But it doesn't update and I have absolutely NO reason why this isn't
> >> working. The database it's updating has a primary key. I am getting an
> >> instance of the database entry, then trying to update it with a new
> > figure.
> >>
> >> num.setValue(myString);
> >> num.save();
> >>
> >> --
> >
>
> --
> View this message in context: http://www.nabble.com/Update-not-working-
> tf3871748.html#a10969809
> Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


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


RE: Update not working

Posted by croniccoder <ch...@yahoo.com>.
Thank you foor response. The table I am trying to update does have a primary
key. I seem to just be using basic torque code, and it isn't working, and
for the life of me, I can't figure out WHY!


Thomas Fischer-11 wrote:
> 
> update is known not to work if your table has no primary key. This might
> be
> the cause of your problem.
> 
> It is encouraged very strongly to use primary keys for all your tables.
> 
>    Regards,
> 
>       Thomas
> croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:22:47:
> 
>>
>> I am trying to update a value in my database, and am using the code
> below.
>> But it doesn't update and I have absolutely NO reason why this isn't
>> working. The database it's updating has a primary key. I am getting an
>> instance of the database entry, then trying to update it with a new
> figure.
>>
>> num.setValue(myString);
>> num.save();
>>
>> --
> 

-- 
View this message in context: http://www.nabble.com/Update-not-working-tf3871748.html#a10969809
Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.


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


RE: Update not working

Posted by Thomas Fischer <fi...@seitenbau.net>.
update is known not to work if your table has no primary key. This might be
the cause of your problem.

It is encouraged very strongly to use primary keys for all your tables.

   Regards,

      Thomas
croniccoder <ch...@yahoo.com> schrieb am 05.06.2007 15:22:47:

>
> I am trying to update a value in my database, and am using the code
below.
> But it doesn't update and I have absolutely NO reason why this isn't
> working. The database it's updating has a primary key. I am getting an
> instance of the database entry, then trying to update it with a new
figure.
>
> num.setValue(myString);
> num.save();
>
> --
> View this message in context: http://www.nabble.com/Update-not-working-
> tf3871748.html#a10969340
> Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


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