Package org.apache.cayenne

Examples of org.apache.cayenne.ObjectContext.select()


    public void testConcurrentInserts() throws Exception {
    final DataMap dataMap = runtime.getDataDomain().getDataMap("qualified");
   
    // clear out the table
    ObjectContext context = runtime.newContext();
    List<Qualified1> qualified1s = context.select(SelectQuery.query(Qualified1.class, null));
    context.deleteObjects(qualified1s);
    context.commitChanges();
   
    // perform concurrent inserts
    int numThreads = 2;
View Full Code Here


    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
   
    // check for gaps in the generated sequence numbers
    qualified1s = context.select(SelectQuery.query(Qualified1.class, null));
    assertEquals(100 * numThreads, qualified1s.size());
   
    Collections.sort(qualified1s, new Comparator<Qualified1>() {
      public int compare(Qualified1 left, Qualified1 right) {
        Integer leftPk = Cayenne.intPKForObject(left);
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.