Package org.monjo.example

Examples of org.monjo.example.ComplexPojo


    pojo.setaDoubleField(44.0);
    return pojo;
  }

  public static ComplexPojo createComplexPojo(Category category) {
    ComplexPojo complexPojo = new ComplexPojo();
    LinkedList<Category> categories = new LinkedList<Category>();
    categories.add(category);
    complexPojo.setCategory(category);
    complexPojo.setDescription("pojo complexo");
    return complexPojo;
  }
View Full Code Here


    Category category = new Category();
    category.setName("NewCategory");
    Monjo<ObjectId, Category> monjoCategory = new Monjo<ObjectId, Category>(getMongoDB(), Category.class);
    monjoCategory.insert(category);

    ComplexPojo complexPojo = PojoBuilder.createComplexPojo(category);
//    complexPojo.setCategories(categories);
    Monjo<ObjectId, ComplexPojo> monjoComplex = new Monjo<ObjectId, ComplexPojo>(getMongoDB(), ComplexPojo.class);

    monjoComplex.removeAll();
    monjoCategory.removeAll();

    monjoComplex.insert(complexPojo);
   
    MonjoCursor<ComplexPojo> monjoCursor = monjoComplex.find();
    ComplexPojo complex = monjoCursor.toList().get(0);
    assertEquals(category.getId(), complex.getCategory().getId());
  //  assertEquals(category.getId(), complex.getCategories().get(0).getId());
   
  }
View Full Code Here

TOP

Related Classes of org.monjo.example.ComplexPojo

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.