Package org.monjo.example

Examples of org.monjo.example.PojoWithListInnerObject.addCategory()


    monjoComplex.removeAll();
   
    monjoComplex.insert(pojo);
    Category otherCategory = new Category();
    otherCategory.setName("Other Category");
    pojo.addCategory(otherCategory);
   
    monjoComplex.update(pojo);   
    MonjoCursor<PojoWithListInnerObject> monjoCursor = monjoComplex.find();
    PojoWithListInnerObject complex = monjoCursor.toList().get(0);
    assertEquals(2, complex.getCategories().size());
View Full Code Here


   
    PojoWithListInnerObject anotherPojo  = new PojoWithListInnerObject();
    anotherPojo.setId(pojo.getId());
    Category otherCategory = new Category();
    otherCategory.setName("Other Category");
    anotherPojo.addCategory(otherCategory);
   
    monjoComplex.updateWithAddSet(anotherPojo);
   
    MonjoCursor<PojoWithListInnerObject> monjoCursor = monjoComplex.find();
    PojoWithListInnerObject complex = monjoCursor.toList().get(0);
View Full Code Here

   
    PojoWithListInnerObject anotherObject = new PojoWithListInnerObject();
    Category category   = new Category();
    category.setWeight(200l);
    category.setId(inicialCategory.getId());
    anotherObject.addCategory(category);
   
    monjo.updateInnerObject(anotherObject, "categories");
   
    PojoWithListInnerObject result = monjo.findOne(innerObject.getId());
    Category categoryResult = result.getCategories().get(0);
View Full Code Here

    Monjo<ObjectId, PojoWithListInnerObject> monjo = new Monjo<ObjectId, PojoWithListInnerObject>(getMongoDB(), PojoWithListInnerObject.class);
    monjo.removeAll();
    monjo.insert(createMegaZordePojo);
   
    PojoWithListInnerObject createMegaZordePojo2 = new PojoWithListInnerObject();
    createMegaZordePojo2.addCategory(createMegaZordePojo.getCategories().get(0));
    PojoWithListInnerObject result = monjo.findByExample(createMegaZordePojo).toList().get(0);
    assertNotNull(result.getCategories().get(0).getId());
  }

  @Test
View Full Code Here

    List<Category> categories = createMegaZordePojo.getCategories();

    createMegaZordePojo = new PojoWithListInnerObject();
    Category findCategory = new Category();
    findCategory.setId(categories.get(0).getId());
    createMegaZordePojo.addCategory(findCategory);

   
    PojoWithListInnerObject result = monjo.findByExample(createMegaZordePojo).toList().get(0);
    assertNotNull(result.getCategories().get(0).getId());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.