Class LiveRef<T>
java.lang.Object
com.googlecode.objectify.Ref<T>
com.googlecode.objectify.impl.ref.LiveRef<T>
- All Implemented Interfaces:
Serializable
,Comparable<Ref<T>>
Implementation of Refs which are "live" and connected to the datastore so they can fetch entity values even if they have not already been loaded. This is the standard Ref implementation.
- Author:
- Jeff Schnitzer invalid input: '<'[email protected]>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Objectify
So that Refs can be associated with a session -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ofy
So that Refs can be associated with a session
-
-
Constructor Details
-
LiveRef
protected LiveRef()For GWT serialization -
LiveRef
Create a Ref based on the key -
LiveRef
Create a Ref based on the key, with the specified session
-
-
Method Details
-
get
Description copied from class:Ref
Obtain the entity value associated with the key. Will pull from session if present, otherwise will fetch from the datastore. -
isLoaded
public boolean isLoaded()Description copied from class:Ref
If an entity has been loaded into the session or is otherwise available, this will return true. Calls to get() will not require a trip to backing store. Note that even when loaded, get() can still return null if there is no entity which corresponds to the key. -
writeReplace
When this serializes, write out the DeadRef version. Use the getValue() for value so that if the value is not loaded, it serializes as null.- Throws:
ObjectStreamException
-