/**
 * Copyright (c) 2015 TerraFrame, Inc. All rights reserved.
 *
 * This file is part of Geoprism(tm).
 *
 * Geoprism(tm) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Geoprism(tm) is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Geoprism(tm).  If not, see <http://www.gnu.org/licenses/>.
 */
package net.geoprism.report;


/**
 *
 * @author Autogenerated by RunwaySDK
 */
public class ReportItemViewQuery extends net.geoprism.report.ReportItemViewQueryBase  
{

  public ReportItemViewQuery(com.runwaysdk.query.QueryFactory queryFactory)
  {
    super(queryFactory);
    this.buildQuery(new DefaultReportItemViewBuilder(queryFactory));
  }

  public ReportItemViewQuery(com.runwaysdk.query.QueryFactory queryFactory, com.runwaysdk.query.ViewQueryBuilder viewQueryBuilder)
  {
    super(queryFactory, viewQueryBuilder);
  }

  class DefaultReportItemViewBuilder extends com.runwaysdk.query.ViewQueryBuilder 
  {
    private ReportItemQuery query;
    
    public DefaultReportItemViewBuilder(com.runwaysdk.query.QueryFactory queryFactory)
    {
      super(queryFactory);
      
      this.query = new ReportItemQuery(queryFactory);
    }

    protected ReportItemViewQuery getViewQuery()
    {
      return (ReportItemViewQuery)super.getViewQuery();
    }

    /**
     * build the select clause
     */
    protected void buildSelectClause()
    {
      ReportItemViewQuery vQuery = this.getViewQuery();
      vQuery.map(ReportItemView.DASHBOARDLABEL, this.query.getDashboard().getDisplayLabel().localize());
      vQuery.map(ReportItemView.REPORTLABEL, this.query.getReportLabel().localize());
      vQuery.map(ReportItemView.REPORTID, this.query.getOid());
      vQuery.map(ReportItemView.REPORTNAME, this.query.getReportName());     
    }

    /**
     * Implement only if additional join criteria is required.
     */
    protected void buildWhereClause()
    {

    }

  }
}
