Package com.googlecode.objectify.impl

Examples of com.googlecode.objectify.impl.Path


  /**
   */
  @Test
  public void simplePOJOTranslates() throws Exception {
    Path thingPath = Path.root().extend("somewhere");

    CreateContext createCtx = new CreateContext(fact());
    ClassTranslator<Thing> translator = ClassTranslatorFactory.createEmbeddedClassTranslator(Thing.class, createCtx, thingPath);

    Thing thing = new Thing();
View Full Code Here


    indexInstruction = getIndexInstruction(clazz);

    // Find all the basic properties
    for (Property prop: getDeclaredProperties(ctx.getFactory(), clazz)) {
      if (INCLUDED_FIELDS.apply(prop)) {
        Path propPath = path.extend(prop.getName());
        try {
          Translator<Object, Object> translator = ctx.getTranslator(new TypeKey<>(prop), ctx, propPath);
          PropertyPopulator<Object, Object> tprop = new PropertyPopulator<>(prop, translator);
          props.add(tprop);
        } catch (Exception ex) {
          // Catch any errors during this process and wrap them in an exception that exposes more useful information.
          propPath.throwIllegalState("Error registering " + clazz.getName(), ex);
        }
      }
    }

    // Find the @OnSave methods
View Full Code Here

        EmbeddedEntity emb = new EmbeddedEntity();

        for (Map.Entry<Object, Object> entry: pojo.entrySet()) {
          String key = stringifier.toString(entry.getKey());
          Path propPath = path.extend(key);
          Object value = componentTranslator.save(entry.getValue(), index, ctx, propPath);

          DatastoreUtils.setContainerProperty(emb, key, value, index, ctx, propPath);
        }
View Full Code Here

TOP

Related Classes of com.googlecode.objectify.impl.Path

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.