Package org.odbms

Examples of org.odbms.Query.execute()


        }
      }
    });
    query.constrain("DTITLE", OP.STARTS_WITH, "John");

    ObjectSet<Disc> discs = query.execute();
    for (Disc disc : discs) {
      if (disc.getAge() > 3)
        fail("Disc age >3");
      if (!disc.getDTITLE().startsWith("John"))
        fail("DTITLE does not start with 'John'");
View Full Code Here


    Util.enter("QBE: Album.year=1969");

    Query query = gtm.query(Album.class);
    query.constrain("year", OP.EQUALS, null, "1969");

    ObjectSet<Album> albums = query.execute();
    Util.snapshot();
    for (Album album : albums) {
      System.out.println("Album " + album.getOID() + " " + album.getName() + " " + album.getYear());
    }
    Util.leave(albums.size());
View Full Code Here

        }
      }
    });
    query.constrain("DTITLE", OP.STARTS_WITH, "The");

    ObjectSet<Disc> discs = query.execute();
    for (Disc disc : discs) {
      if (disc.getAge() < 10) {
        cnt.decrementAndGet();
      } else {
        fail("Disc age is greater 10 years");
View Full Code Here

  {
    int cnt = 0;

    Query query = db.query(Person.class);
    query.constrain("lastName", OP.EQUALS, FUNCTION.TO_UPPER, "joeckel");
    ObjectSet<Person> joeckels = query.execute();
    for (Person p : joeckels) {
      if (!"Lothar".equals(p.getFirstName()) || !"Joeckel".equals(p.getLastName()))
        fail("Invalid data in firstName || lastName");
      cnt++;
    }
View Full Code Here

  public void testCustomerWithName()
  {
    int cnt = 0;
    Query query = db.query(Customer.class);
    query.constrain("companyName", OP.EQUALS, FUNCTION.TO_UPPER, "MI6");
    ObjectSet<Customer> customers = query.execute();
    for (Customer p : customers) {
      if (!"GOLD4712".equals(p.getCustNr()) || !"MI6".equals(p.getCompanyName()))
        fail("Invalid data in custNr || companyName");
      cnt++;
    }
View Full Code Here

          return false;
        }
      }
    }, compByAge);

    ObjectSet<Disc> discs = query.execute();

    if (cnt.intValue() == 0)
      fail("No rows found");

    int lastAge = -1;
View Full Code Here

        }
      }
    }, compByAge);
    query.constrain("DTITLE", OP.CONTAINS, "Band");

    ObjectSet<Disc> discs = query.execute();

    if (cnt.intValue() == 0)
      fail("No rows found");

    for (Disc disc : discs) {
View Full Code Here

        }
      }
    });
    query.constrain("DTITLE", OP.STARTS_WITH, "John");

    ObjectSet<Disc> discs = query.execute();
    int processed = 0;
    for (Disc disc : discs) {
      int age = disc.getAge();
      boolean valid = (age <= 3 && age != -1) && disc.getDTITLE().startsWith("John");
      if (valid)
View Full Code Here

  private void query()
  {
    Query q1 = db.query(LogEntry.class);
    q1.constrain("date", OP.GREATER, currentTime);

    ObjectSet<LogEntry> entries = q1.execute();

    for (LogEntry entry : entries) {
      System.out.println(entry + " exists=" + entry.getFile().exists());
    }
View Full Code Here

  {
    Query q1 = db.query(LogEntry.class);
    // q1.constrain("date", OP.GREATER, currentTime);
    q1.constrain("date", OP.RANGE, e1.getDate().getTime(), e2.getDate().getTime());

    ObjectSet<LogEntry> entries = q1.execute();

    int cnt = 0;
    for (LogEntry entry : entries) {
      cnt++;
      System.out.println(entry + " exists=" + entry.getFile().exists());
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.