Example #1
0
 @PUT("touched")
 public List<Child> touchCollection(IdRef<Parent> parentId) {
   List<Child> childs = yawp(Child.class).from(parentId).order("name").list();
   for (Child child : childs) {
     child.setName("touched " + child.getName());
   }
   return childs;
 }
Example #2
0
  @Test
  public void testSaveChild() {
    Parent parent = new Parent();
    yawp.save(parent);

    Child child = new Child("xpto");
    child.setParentId(parent.getId());
    yawp.save(child);

    Parent retrievedParent = parent.getId().fetch();
    Child retrievedChild = child.getId().fetch();

    assertEquals(retrievedChild.getParentId(), retrievedParent.getId());
    assertEquals("xpto", retrievedChild.getName());
  }
Example #3
0
 @PUT("touchedParams")
 public Child touchParams(IdRef<Child> id, Map<String, String> params) {
   Child child = id.fetch();
   child.setName("touched " + child.getName() + " by " + params.get("arg"));
   return child;
 }
Example #4
0
 @PUT("touched")
 public Child touchObject(IdRef<Child> id) {
   Child child = id.fetch();
   child.setName("touched " + child.getName());
   return child;
 }