Package com.google.code.gaeom

Examples of com.google.code.gaeom.ObjectStoreSession.find()


  @Test
  public void testFindAll()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).now());
    assertEquals(allPeople, people);
  }

  @Test
  public void testLimit()
View Full Code Here


  @Test
  public void testLimit()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).sort("firstName").limit(3).now());
    assertEquals(3, people.size());
    assertEquals(Lists.newArrayList(cBamBamRubble, cBarneyRubble, cBettyRubble), people);
  }

  @Test
View Full Code Here

  @Test
  public void testLimitDescending()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).sort("firstName", Find.Sort.Descending).limit(3).now());
    assertEquals(3, people.size());
    assertEquals(Lists.newArrayList(cWilmaFlintstone, cSallyStruthers, cFredFlintstone), people);
  }

  @Test
View Full Code Here

  @Test
  public void testOffset()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).sort("firstName").start(3).now());
    assertEquals(3, people.size());
    assertEquals(Lists.newArrayList(cFredFlintstone, cSallyStruthers, cWilmaFlintstone), people);
  }

  @Test
View Full Code Here

  @Test
  public void testBeginsWithFilter()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).filterBeginsWith("firstName", "B").sort("firstName").now());
    assertEquals(3, people.size());
    assertEquals(Lists.newArrayList(cBamBamRubble, cBarneyRubble, cBettyRubble), people);
  }

  @Test
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.