Package com.google.code.gaeom

Examples of com.google.code.gaeom.ObjectStoreSession


  }

  @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);
  }
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);
  }
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);
  }
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);
  }
View Full Code Here

  }

  @Test
  public void testEqualsFilter()
  {
    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();
    List<Person> people = Lists.newArrayList(oss.find(Person.class).filter("firstName", "BamBam").now());
    assertEquals(1, people.size());
    assertEquals(Lists.newArrayList(cBamBamRubble), people);
  }
View Full Code Here

TOP

Related Classes of com.google.code.gaeom.ObjectStoreSession

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.