Examples of OrmQueryDetail


Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

          }
        }
      }
    }

    OrmQueryDetail detail = new OrmQueryDetail();

    // transfer PathProperties into OrmQueryDetail
    Iterator<String> pathIt = pathProps.getPaths().iterator();
    while (pathIt.hasNext()) {
      String path = pathIt.next();
      Set<String> props = pathProps.get(path);
      detail.getChunk(path, true).setDefaultProperties(null, props);
    }

    // build SqlTree based on OrmQueryDetail of the RawSql
    return new SqlTreeBuilder(request, predicates, detail).build();
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

    Ebean.save(f1);

    ServerCache beanCache = Ebean.getServerCacheManager().getBeanCache(FeatureDescription.class);
    beanCache.getStatistics(true);

    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select("name");
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);

    Query<FeatureDescription> query = Ebean.find(FeatureDescription.class).setId(f1.getId());

    tunedInfo.autoFetchTune((SpiQuery<?>) query);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  }

  private void checkQuery(Query<?> q) {

    SpiQuery<?> sq = (SpiQuery<?>) q;
    OrmQueryDetail detail = sq.getDetail();

    Assert.assertNotNull(detail.getChunk("customer", false));
    Assert.assertFalse(detail.getChunk("customer", false).isQueryFetch());
    Assert.assertFalse(detail.getChunk("customer", false).isLazyFetch());

    Assert.assertNotNull(detail.getChunk("customer.contacts", false));
    Assert.assertFalse(detail.getChunk("customer.contacts", false).isQueryFetch());
    Assert.assertFalse(detail.getChunk("customer.contacts", false).isLazyFetch());

    Assert.assertNotNull(detail.getChunk("details", false));
    Assert.assertTrue(detail.getChunk("details", false).isQueryFetch());
    Assert.assertTrue(detail.getChunk("details", false).isLazyFetch());

    Assert.assertEquals(4, detail.getChunk("details", false).getQueryFetchBatch());
    Assert.assertEquals(5, detail.getChunk("details", false).getLazyFetchBatch());

    Assert.assertTrue(detail.getChunk("details", false).allProperties());

  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

      while (it.hasNext()) {
        StatisticsNodeUsage statsNode = it.next();
        statsNode.buildTunedFetch(pathProps, rootDesc);
      }

          OrmQueryDetail detail = new OrmQueryDetail();

      Collection<Props> pathProperties = pathProps.getPathProps();
      for (Props props : pathProperties) {
          if (!props.isEmpty()){
              detail.addFetch(props.getPath(), props.getPropertiesAsString(), null);
          }
            }
     
      detail.sortFetchPaths(rootDesc);
            return detail;
    }
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

                // previously was an entity but not longer
               
            } else {
                // Determine the fetch plan from the latest statistics.
                // Use this to compare with current "tuned fetch plan".
                OrmQueryDetail newFetchDetail = statistics.buildTunedFetch(beanDescriptor);
               
                // get the current tuned fetch info...
                TunedQueryInfo currentFetch = tunedQueryInfoMap.get(queryPoint.getKey());

                if (currentFetch == null) {
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  @Test
  public void withSelectNull() {
   
    init();
   
    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select(null);
   
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);
     
    Query<Order> query = server.find(Order.class).setId(1);
   
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  @Test
  public void withSelectEmpty() {
   
    init();
   
    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select("");
   
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);
     
    Query<Order> query = server.find(Order.class).setId(1);
   
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  @Test
  public void withSelectSomethingThatDoesNotExist() {
   
    init();
   
    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select("somethingThatDoesNotExist");
   
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);
     
    Query<Order> query = server.find(Order.class).setId(1);
   
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  @Test
  public void withSelectSomeIncludeLazyLoaded() {
   
    init();

    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select("status, customer");
   
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);
     
    Query<Order> query = server.find(Order.class).setId(1);
   
View Full Code Here

Examples of com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail

  @Test
  public void withSelectSome() {
   
    init();
   
    OrmQueryDetail tunedDetail = new OrmQueryDetail();
    tunedDetail.select("status");
   
    TunedQueryInfo tunedInfo = new TunedQueryInfo(null, tunedDetail, 0);
     
    Query<Order> query = server.find(Order.class).setId(1);
   
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.