Package com.avaje.ebean.bean

Examples of com.avaje.ebean.bean.ObjectGraphOrigin


  }

  public ObjectGraphNode setOrigin(CallStack callStack) {

    // create a 'origin' which links this query to the profiling information
    ObjectGraphOrigin o = new ObjectGraphOrigin(calculateOriginQueryHash(), callStack, beanType.getName());
    parentNode = new ObjectGraphNode(o, null);
    return parentNode;
  }
View Full Code Here


      // customer.getContacts()
    }

    SpiQuery<?> sq = (SpiQuery<?>) q;
    ObjectGraphNode parentNode = sq.getParentNode();
    ObjectGraphOrigin origin = parentNode.getOriginQueryPoint();

    System.out.println("Origin:" + origin.getKey());

    // MetaAutoFetchStatistic metaAutoFetchStatistic =
    // ((DefaultOrmQuery<?>)q).getMetaAutoFetchStatistic();
    // if (metaAutoFetchStatistic != null) {
    // List<NodeUsageStats> nodeUsageStats =
View Full Code Here

        }
  }
 
  private void updateTunedQueryFromUsage(Counters counters, Statistics statistics) {
     
      ObjectGraphOrigin queryPoint = statistics.getOrigin();
        String beanType = queryPoint.getBeanType();

        try {
            Class<?> beanClass = ClassUtil.forName(beanType, this.getClass());
            BeanDescriptor<?> beanDescriptor = server.getBeanDescriptor(beanClass);
            if (beanDescriptor == null){
                // 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) {
                    // its a new fetch plan, add it.
                    counters.incrementNew();

                    currentFetch = statistics.createTunedFetch(newFetchDetail);
                    logging.logNew(currentFetch);
                    tunedQueryInfoMap.put(queryPoint.getKey(), currentFetch);

                } else if (!currentFetch.isSame(newFetchDetail)) {
                    // the fetch plan has changed, update it.
                    counters.incrementModified();
                   
View Full Code Here

   * resulting from traversal of the object graph.
   */
  public void collectQueryInfo(ObjectGraphNode node, long beans, long micros) {

    if (node != null){
      ObjectGraphOrigin origin = node.getOriginQueryPoint();
      if (origin != null){
        Statistics stats = getQueryPointStats(origin);
        stats.collectQueryInfo(node, beans, micros);       
      }
    }
View Full Code Here

   * is called on the bean.
   * </p>
   */
  public void collectNodeUsage(NodeUsageCollector usageCollector) {

    ObjectGraphOrigin origin = usageCollector.getNode().getOriginQueryPoint();

    Statistics stats = getQueryPointStats(origin);

    if (logging.isTraceUsageCollection()){
      System.out.println("... NodeUsageCollector "+usageCollector);
View Full Code Here

TOP

Related Classes of com.avaje.ebean.bean.ObjectGraphOrigin

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.