Closed GoogleCodeExporter closed 9 years ago
Whoops! I meant to file this as an enhancement but can't change it now. Sorry.
Original comment by joe...@gmail.com
on 22 Jun 2011 at 12:13
Just today, we spoke about such a feature. Our use case goes as follows:
We have one kind of entity, and two ways to access it:
- "Preview" object with just the basic properties (cheap to send lists of those objects over the network)
- "Full" object containing all properties (expensive to send, queried individually on-demand)
My first thought was the same: one kind in the Datastore and two classes to
access it.
Any idea how we can model this with Objectify?
Original comment by mar...@greenrobot.de
on 22 Jun 2011 at 4:20
The "standard" way of modeling this is to simply construct the new DTO from the
data loaded in the entity pojo. I have some misgivings about having a partial
entity since someone could accidentally save it... the alternate would have to
be non-saveable. But I see the point.
Original comment by lhori...@gmail.com
on 22 Jun 2011 at 4:43
Right, copying the selection of properties into a DTO is probably the best way
to do it.
Hmm, partial entities would not improve performance, I guess, because Google's
data store returns the full data anyway, right?
Original comment by mar...@greenrobot.de
on 22 Jun 2011 at 5:07
I may be naive here. I created this feature request because I assumed that the
specific fields can be requested when making an entity request (only because
that flexibility is available with Amazon SimpleDB). If this is not the case
than this feature request doesn't add too much value.
Original comment by joe...@gmail.com
on 22 Jun 2011 at 5:11
Google's datastore always returns the full Entity, all properties. The only
thing you would be shaving off is the overhead of Objectify translating those
properties from an Entity to the fields of your POJO - but this is a very, very
tiny sliver of the cost of loading an entity.
If the goal of this is efficiency, it really isn't worth it.
Original comment by lhori...@gmail.com
on 22 Jun 2011 at 5:15
Thanks for confirming. For me, there's no more need for this enhancement.
Original comment by mar...@greenrobot.de
on 22 Jun 2011 at 5:23
Agreed. I'm going to put a request for this with app engine directly which I'm
sure they'll ignore :) Thanks.
Original comment by joe...@gmail.com
on 22 Jun 2011 at 5:25
Ok, closing this as WontFix. If someone really wants this feature sometime
later, it can be re-opened.
Original comment by lhori...@gmail.com
on 22 Jun 2011 at 5:30
It would be great if anyone who is interested in this feature could start this:
http://code.google.com/p/googleappengine/issues/detail?id=5233
Original comment by joe...@gmail.com
on 22 Jun 2011 at 5:38
You got my star. Thanks for opening the issue - is this really the first time
someone requested it? Unbelievable... ;)
Once App Engine is capable of doing that, we should reopen the ticket. :)
Original comment by mar...@greenrobot.de
on 22 Jun 2011 at 5:51
To be honest, I'm not sure that feature request is a great one. It might (or
might not) make a big difference if you have a lot of blob data you don't need
to select. This is something that presumably Google has measured, and they
have judged it as not sufficiently valuable in exchange for the significant
amount of complexity it introduces.
I dunno.
Original comment by lhori...@gmail.com
on 22 Jun 2011 at 6:47
Original issue reported on code.google.com by
joe...@gmail.com
on 22 Jun 2011 at 12:12