Class ClassPopulator<P>
java.lang.Object
com.googlecode.objectify.impl.translate.ClassPopulator<P>
- All Implemented Interfaces:
Populator<P>
Used by translators to populate properties between POJO and PropertiesContainer. Unlike translators, this does not create the POJO or container, it just copies translated properties between them.
Always excludes the key fields, @Id and @Parent.
- Author:
- Jeff Schnitzer invalid input: '<'[email protected]>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the key metadata but only if this was an @Entity annotated class.void
load
(com.google.cloud.datastore.FullEntity<?> node, LoadContext ctx, Path path, P into) Loads the content of the specified datastore node into an existing POJO.void
save
(P pojo, boolean index, SaveContext ctx, Path path, com.google.cloud.datastore.FullEntity.Builder<?> into) Saves data from the POJO into the entity builder.
-
Constructor Details
-
ClassPopulator
-
-
Method Details
-
load
Description copied from interface:Populator
Loads the content of the specified datastore node into an existing POJO.
-
save
public void save(P pojo, boolean index, SaveContext ctx, Path path, com.google.cloud.datastore.FullEntity.Builder<?> into) Description copied from interface:Populator
Saves data from the POJO into the entity builder.- Specified by:
save
in interfacePopulator<P>
- Parameters:
pojo
- is an object from the pojo entity graph; possibly the whole graph or possibly just a leaf field.index
- is whether the instruction so far is to index or not index property valuespath
- is the path that we have taken to get here, which could be long due to re-entrant translators (ie, an embedded pojo that also has a reference to the same class).
-
getKeyMetadata
Gets the key metadata but only if this was an @Entity annotated class. Should not be called if not.
-