Package org.spring.mongodb.example

Examples of org.spring.mongodb.example.OmAreaBean


  }

  @Test
  public void testOmArea() {

    OmAreaBean bean1 = new OmAreaBean(1, "广东省", "10", 0, "广东省");
    OmAreaBean bean2 = new OmAreaBean(200, "广州", "11", 1, "广州");
    OmAreaBean bean3 = new OmAreaBean(755, "深圳", "12", 1, "深圳");
    OmAreaBean bean4 = new OmAreaBean(769, "东莞", "13", 1, "东莞");
    OmAreaBean bean5 = new OmAreaBean(757, "佛山", "15", 1, "佛山");
    OmAreaBean bean6 = new OmAreaBean(760, "中山", "16", 1, "中山");
    OmAreaBean bean7 = new OmAreaBean(752, "惠州", "17", 1, "惠州");
    OmAreaBean bean8 = new OmAreaBean(754, "汕头", "18", 1, "汕头");
    OmAreaBean bean9 = new OmAreaBean(750, "江门", "19", 1, "江门");
    OmAreaBean bean10 = new OmAreaBean(756, "珠海", "20", 1, "珠海");
    OmAreaBean bean11 = new OmAreaBean(663, "揭阳", "21", 1, "揭阳");
    OmAreaBean bean12 = new OmAreaBean(759, "湛江", "22", 1, "湛江");
    OmAreaBean bean13 = new OmAreaBean(668, "茂名", "23", 1, "茂名");
    OmAreaBean bean14 = new OmAreaBean(758, "肇庆", "25", 1, "肇庆");
    OmAreaBean bean15 = new OmAreaBean(753, "梅州", "26", 1, "梅州");
    OmAreaBean bean16 = new OmAreaBean(768, "潮州", "27", 1, "潮州");
    OmAreaBean bean17 = new OmAreaBean(660, "汕尾", "28", 1, "汕尾");
    OmAreaBean bean18 = new OmAreaBean(763, "清远", "29", 1, "清远");
    OmAreaBean bean19 = new OmAreaBean(762, "河源", "30", 1, "河源");
    OmAreaBean bean20 = new OmAreaBean(751, "韶关", "31", 1, "韶关");
    OmAreaBean bean21 = new OmAreaBean(662, "阳江", "32", 1, "阳江");
    OmAreaBean bean22 = new OmAreaBean(766, "云浮", "33", 1, "云浮");

    List<OmAreaBean> list = new ArrayList<OmAreaBean>();

    list.add(bean1);
    list.add(bean2);
    list.add(bean3);
    list.add(bean4);
    list.add(bean5);
    list.add(bean6);
    list.add(bean7);
    list.add(bean8);
    list.add(bean9);
    list.add(bean10);
    list.add(bean11);
    list.add(bean12);
    list.add(bean13);
    list.add(bean14);
    list.add(bean15);
    list.add(bean16);
    list.add(bean17);
    list.add(bean18);
    list.add(bean19);
    list.add(bean20);
    list.add(bean21);
    list.add(bean22);

    mongoTemplate.insert(list, OmAreaBean.class);

    OmAreaBean bean = mongoTemplate.findOne(query(where("areaId").is(1)),
        OmAreaBean.class);

    assertThat(bean.getAreaName(), is("广东省"));

    List<OmAreaBean> beans = mongoTemplate.findAll(OmAreaBean.class);

    assertThat(beans.size(), is(22));
View Full Code Here

TOP

Related Classes of org.spring.mongodb.example.OmAreaBean

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.