I just thought of a better way of doing it, but it's not quite as pretty
because it breaks queries. Basically you add a new field to your entity
which could be an integer (like a version number for the entity) or a
boolean for "has had ten added to mycolumn" which defaults to false when
you load your entity (you haven't specified how you're doing this, but I'm
sure there will be a way of doing it using JDO, JPA, Low-level, objectify,
etc.) then you can check when you load it if you need to add 10 then you
can save the updated version correctly.

This method costs you nothing (not technically true, but so close to zero
it's not worth thinking about) except the loss of querying ability if you
do so on mycolumn.

I would probably add some code like this....

class MyEntity
{
  ...
  int version = 0; //default to zero
  long mycolumn;
  ...
}

then when loading...

if (version == 0)
{
  mycolumn += 10;
  version = 1;
}

at a later date, you might add...
if (version == 1)
{
  someOtherColumn = someOtherColumn.toLowerCase();
  version = 2;
}

etc.

On 23 January 2012 17:51, Gal Dolber <gal.dol...@gmail.com> wrote:

> If you need to do it all at once there's no secret trick or magic to do
> it. You can use backends servers, cron jobs, task queues o the
> appengine-mapper but in all cases you'll have to pay
> number_of_entities*(get_price + put_price) plus all the processing price.
>
> On Mon, Jan 23, 2012 at 1:39 PM, Matthew Jaggard 
> <matt...@jaggard.org.uk>wrote:
>
>> Unfortunately that's basically the only option.
>>
>> Maybe someone can comment on MapReduce, although from what I understand
>> it's not any cheaper.
>>
>> On 23 January 2012 15:33, kt <kanutripa...@cypatterns.com> wrote:
>>
>>> Hi,
>>> I have a situation where I need to update a property in several entities
>>> amass. Something similar in SQL would be :
>>> update mytable set mycolumn = (mycolumn + 10);
>>>
>>> I do not want to iterate through all entities since it will be very
>>> expensive. Any ideas?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine for Java" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/google-appengine-java/-/1GQxcYEFTPsJ.
>>> To post to this group, send email to
>>> google-appengine-java@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-java@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>
>
> --
> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>
> http://code.google.com/p/guit/
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to