Why Ref.Create(value) is dangerous

66 views
Skip to first unread message

you...@digiwincorp.com

unread,
Feb 4, 2014, 5:39:21 AM2/4/14
to objectify...@googlegroups.com
hi everyone, first i would like to thank you for your hard work to make our tasks easy. Like the title of this post indicates, i have a question about the method Create of the class Ref, i would like to know what is the difference between Ref.Create(value) and Ref.Create(key) and also why the objectify's javadoc warns me about it ( it says :"Doesn't set the key!!!Dangerous"). and sorry for the disturbance.
Thank you.
Youssef DEHBI ALAOUI

you...@digiwincorp.com

unread,
Feb 10, 2014, 1:34:32 PM2/10/14
to objectify...@googlegroups.com
hello Jeff can you save us??!! pleaaase!!!  :(

Jeff Schnitzer

unread,
Feb 11, 2014, 2:50:00 PM2/11/14
to objectify...@googlegroups.com
Sorry, I've been off-grid for several days.

First, be careful of mixing up Ref (as the compiler normally sees) and
Ref (the GWT super-source). Normally you work with LiveRef objects,
which have methods that can pull the referenced entity out of the
session. DeadRef objects are used by GWT serialization to be able to
send the actual entity referenced across the wire. It's not a great
mechanism but it works. If you aren't using GWT, ignore this,
including the javadoc comment you mention.

Ref.create(key) makes a ref associated with the key
Ref.create(value) figures out the key of the value (entity) and calls
Ref.create(key).

It will take me another day or two to work though my email backlog. Sorry.

Jeff



On Mon, Feb 10, 2014 at 10:34 AM, <you...@digiwincorp.com> wrote:
> hello Jeff can you save us??!! pleaaase!!! :(
>
> --
> You received this message because you are subscribed to the Google Groups
> "objectify-appengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to objectify-appen...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

you...@digiwincorp.com

unread,
Feb 12, 2014, 11:26:16 AM2/12/14
to objectify...@googlegroups.com
Thanks Jeff 
Reply all
Reply to author
Forward
0 new messages