Package javax.jdo

Examples of javax.jdo.PersistenceManager.newQuery()


        Event.class, Organisation.class, Unit.class, Village.class, Booking.class
    };
   
    for(Class clazz: classesToDelete)
    {
      Query query = pm.newQuery(clazz);
        query.deletePersistentAll();
    }
   
 
    // Insert new data
View Full Code Here


 
  @Test
  public void testFixtureCreatesData()
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Collection<Event> events = (Collection<Event>) pm.newQuery(Event.class).execute();
    events = pm.detachCopyAll(events);
    pm.close();
   
    List<String> expectedEvents = Arrays.asList("Test event 1", "Other event", "Closed event");
   
View Full Code Here

       
          try {
            for (String user  : listIdUsers) {
            /// query
          Query query = pm.newQuery(DaoCommunityAccount2.class);
            query.setFilter("idUser == nameParam");
            query.setOrdering("name desc");
            query.setOrdering("dateCommunityAccount desc");
            query.setRange(0, range); //only 6 results
            //query.setOrdering("hireDate desc");
View Full Code Here

       
          try {
            for (String user  : listIdUsers) {
            /// query
          Query query = pm.newQuery(DaoCommunityAccount2.class);
            query.setFilter("idUser == nameParam");
            query.setOrdering("name desc");
            query.setOrdering("dateCommunityAccount desc");
            query.setRange(0, range); //only a few results
            //query.setOrdering("hireDate desc");
View Full Code Here

       
          try {
            for (String user  : listIdUsers) {
            /// query
          Query query = pm.newQuery(DaoCommunityAccount2.class);
            query.setFilter("idUser == nameParam");
            query.setOrdering("name desc");
            query.setOrdering("dateCommunityAccount desc");
            query.setRange(0, range); //only 6 results
            //query.setOrdering("hireDate desc");
View Full Code Here

       
          try {
            for (String user  : listIdUsers) {
            /// query
          Query query = pm.newQuery(DaoCommunityAccount2.class);
            query.setFilter("idUser == nameParam");
            query.setOrdering("name desc");
            query.setOrdering("dateCommunityAccount desc");
            query.setRange(0, 6); //only 6 results
            //query.setOrdering("hireDate desc");
View Full Code Here

  public static Collection<Event> allEvents(boolean showNonOpenEvents)
  { 
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Event.class);
    query.setOrdering("name");
   
    if(!showNonOpenEvents) query.setFilter("isCurrentlyOpen == true");
   
    return queryDetachAndClose(Event.class, query, true);
View Full Code Here

   */
  public static Event eventByName(String eventName)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Event.class);
    query.setFilter("name == nameParam");
    query.declareParameters("String nameParam");
   
    return querySingleDetachAndClose(Event.class, query, false, eventName);
  }
View Full Code Here

   */
  public static Event eventByName(String eventName, Key ignoreKey)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Event.class);
    query.declareImports("import com.google.appengine.api.datastore.Key");
    if (ignoreKey == null)
    {
      query.setFilter("name == nameParam");
      query.declareParameters("String nameParam");
View Full Code Here

 
  public static Collection<Village> villagesForEvent(Event event)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
   
    Query query = pm.newQuery(Village.class);
    query.setOrdering("name");
    query.declareImports("import com.google.appengine.api.datastore.Key");
    query.setFilter("eventKey == eventKeyParam");
    query.declareParameters("Key eventKeyParam");
   
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.