Pavel Tupitsyn created IGNITE-4376:
--------------------------------------

             Summary: SQL: Failed to run reduce query locally with a valid query
                 Key: IGNITE-4376
                 URL: https://issues.apache.org/jira/browse/IGNITE-4376
             Project: Ignite
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.7
            Reporter: Pavel Tupitsyn
            Assignee: Pavel Tupitsyn
             Fix For: 1.9


Reported by Ignite.NET user:

{code}
javax.cache.CacheException: Failed to run reduce query locally.
    at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:754)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$5.iterator(IgniteH2Indexing.java:1119)
    at 
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:98)
    at 
org.apache.ignite.internal.processors.platform.cache.query.PlatformAbstractQueryCursor.processInLongOutLong(PlatformAbstractQueryCursor.java:142)
    at 
org.apache.ignite.internal.processors.platform.PlatformAbstractTarget.inLongOutLong(PlatformAbstractTarget.java:66)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to parse SQL 
query: SELECT
__C0 NATURALKEY,
((PR.PR_PER_PROJECTS_PERCENTCOMPLETED / 100.0) * SUM(__C1)) AS EXPR1
FROM PUBLIC.__T0
GROUP BY __C0, __C2
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.preparedStatementWithParams(IgniteH2Indexing.java:913)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:985)
    at 
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:709)
    ... 4 more
Caused by: org.h2.jdbc.JdbcSQLException: Column 
"PR.PR_PER_PROJECTS_PERCENTCOMPLETED" not found; SQL statement:
SELECT
__C0 NATURALKEY,
((PR.PR_PER_PROJECTS_PERCENTCOMPLETED / 100.0) * SUM(__C1)) AS EXPR1
FROM PUBLIC.__T0
GROUP BY __C0, __C2 [42122-191]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    at org.h2.message.DbException.get(DbException.java:179)
    at org.h2.message.DbException.get(DbException.java:155)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:147)
    at org.h2.expression.Operation.optimize(Operation.java:181)
    at org.h2.expression.Operation.optimize(Operation.java:181)
    at org.h2.expression.Alias.optimize(Alias.java:51)
    at org.h2.command.dml.Select.prepare(Select.java:852)
    at org.h2.command.Parser.prepareCommand(Parser.java:257)
    at org.h2.engine.Session.prepareLocal(Session.java:560)
    at org.h2.engine.Session.prepareCommand(Session.java:501)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1188)
    at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
    at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:276)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:425)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.preparedStatementWithParams(IgniteH2Indexing.java:910)
    ... 6 more
{code}

Query (works in H2 console):
{code}
select pr.NATURALKEY, (pr.PR_PER_PROJECTS_PERCENTCOMPLETED / 100.0) * 
sum(a.AS_RIO_ASSIGNMENTS_PERIODCOST) as Expr1
from "Landscape".MI_MILESTONES mi 
Inner join "Landscape".PR_HAS_MI_A t0 on t0.MI_ID_A = MI.NATURALKEY 
Inner join "Landscape".PR_HAS_AS_A t1 on t1.PR_ID_HAS = t0.PR_ID_HAS 
Inner join "Landscape".PR_HAS_OW_A t2 on t2.PR_ID_HAS = t0.PR_ID_HAS 
Inner join "Landscape".AS_ASSIGNMENTS a on a.NATURALKEY = t1.AS_ID_A 
inner join "Landscape".PR_PROJECTS pr on pr.NATURALKEY = t0.PR_ID_HAS 
inner join "Landscape".OW_OWNERSHIP ow on ow.NATURALKEY=t2.OW_ID_A 
group by 
pr.NATURALKEY, pr.PR_PER_PROJECTS_PERCENTCOMPLETED
{code}

Query entity config:
{code}
<queryEntities>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_Projects">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="PR_NAM_Projects_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PR_DES_Projects_Description" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PR_FIN_Projects_FinanceCode" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PR_STA_Projects_StartDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="PR_INI_Projects_FinishDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="PR_TAT_Projects_StatusDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="PR_DUR_Projects_Duration" fieldType="System.Int32" 
fieldTypeName="java.lang.Integer" />
        <queryField name="PR_PER_Projects_PercentCompleted" 
fieldType="System.Int32" fieldTypeName="java.lang.Integer" />
        <queryField name="PR_ERC_Projects_PercentWorkComplet" 
fieldType="System.Int32" fieldTypeName="java.lang.Integer" />
        <queryField name="PR_PRO_Projects_ProjectCategory" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PR_LIF_Projects_LifecyclePhase" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PR_RAG_Projects_RAGPast" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PR_AGC_Projects_RAGCurrent" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PR_AGF_Projects_RAGFuture" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PR_QUA_Projects_QualityLevel" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PR_PLA_Projects_PlanType" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PR_WIT_Projects_WithoutAssignments" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="MI_Milestones">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="MI_NAM_Milestones_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="MI_IND_Milestones_Index" fieldType="System.Int32" 
fieldTypeName="java.lang.Integer" />
        <queryField name="MI_ISM_Milestones_IsMilestoneFlag" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
        <queryField name="MI_ISA_Milestones_IsActiveFlag" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
        <queryField name="MI_MIL_Milestones_MilestoneType" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="MI_STA_Milestones_StartDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_FIN_Milestones_FinishDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_PER_Milestones_PercentComplete" 
fieldType="System.Int32" fieldTypeName="java.lang.Integer" />
        <queryField name="MI_BAS_Milestones_Baseline0FinishDat" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_ASE_Milestones_Baseline1FinishDat" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_DAT_Milestones_Date10Percent" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_ATE_Milestones_Date50Percent" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_TEP_Milestones_Date90Percent" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="MI_REP_Milestones_ReportingLevel" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="MI_SEL_Milestones_BaselineRAG" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="MI_MAN_Milestones_ManagementTeamDire" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="AS_Assignments">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="AS_PER_Assignments_PeriodStartDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="AS_ERI_Assignments_PeriodFinishDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="AS_WOR_Assignments_WorkFTE" fieldType="System.Double" 
fieldTypeName="java.lang.Double" />
        <queryField name="AS_ORK_Assignments_WorkDays" 
fieldType="System.Double" fieldTypeName="java.lang.Double" />
        <queryField name="AS_RIO_Assignments_PeriodCost" 
fieldType="System.Decimal" fieldTypeName="java.math.BigDecimal" />
        <queryField name="AS_FTE_Assignments_FTEDaysDelivered" 
fieldType="System.Double" fieldTypeName="java.lang.Double" />
        <queryField name="AS_TEA_Assignments_FTEActualCost" 
fieldType="System.Decimal" fieldTypeName="java.math.BigDecimal" />
        <queryField name="AS_WIT_Assignments_WithoutProjects" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
        <queryField name="AS_ITH_Assignments_WithoutRoles" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
        <queryField name="AS_THO_Assignments_WithoutFTEContract" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PO_Posts">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="PO_NAM_Posts_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PO_ISA_Posts_IsActiveFlag" fieldType="System.Boolean" 
fieldTypeName="java.lang.Boolean" />
        <queryField name="PO_ISG_Posts_IsGenericFlag" 
fieldType="System.Boolean" fieldTypeName="java.lang.Boolean" />
        <queryField name="PO_GRA_Posts_Grade" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="PO_MIL_Posts_MilitaryorCivilian" 
fieldType="System.String" fieldTypeName="java.lang.String" />
        <queryField name="PO_FUN_Posts_FunctionalGroup" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="RO_Roles">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="RO_NAM_Roles_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SU_Suppliers">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SU_NAM_Suppliers_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PE_People">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="PE_NAM_People_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="OW_Ownership">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="OW_NAM_Ownership_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
        <queryField name="OW_STA_Ownership_StartDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
        <queryField name="OW_FIN_Ownership_FinishDate" 
fieldType="System.DateTime" fieldTypeName="java.sql.Timestamp" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="FT_FTEContracts">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="FT_NAM_FTEContracts_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="DE_DeliverableContrac">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="DE_NAM_DeliverableContrac_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SE_ServiceContracts">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SE_NAM_ServiceContracts_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="ER_Services">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="ER_NAM_Services_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="RV_ServiceDeliveries">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="RV_NAM_ServiceDeliveries_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="IN_Incidents">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="IN_NAM_Incidents_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="VI_ServiceLevels">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="VI_NAM_ServiceLevels_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SS_Assets">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SS_NAM_Assets_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="IS_ISSCoreServiceRequ">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="IS_NAM_ISSCoreServiceRequ_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="ES_DesignAuthorityRev">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="ES_NAM_DesignAuthorityRev_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="BU_BusinessUnitServic">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="BU_NAM_BusinessUnitServic_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="US_BUServiceDesigns">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="US_NAM_BUServiceDesigns_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="UI_BUISInitiatives">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="UI_NAM_BUISInitiatives_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SI_BusinessUnitCapabi">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SI_NAM_BusinessUnitCapabi_Name" 
fieldType="System.String" fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="NE_BusinessUnits">
  <fields>
        <queryField name="naturalKey" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="NE_NAM_BusinessUnits_Name" fieldType="System.String" 
fieldTypeName="java.lang.String" />
  </fields>
  <indexes>
        <queryIndex name="naturalkey_asc_idx">
          <fields>
                <queryIndexField name="naturalKey" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_has_MI_a">
  <fields>
        <queryField name="PR_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="MI_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="pr_id_has_asc_idx">
          <fields>
                <queryIndexField name="PR_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="mi_id_a_asc_idx">
          <fields>
                <queryIndexField name="MI_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_has_SU_a">
  <fields>
        <queryField name="PR_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SU_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="su_id_a_asc_idx">
          <fields>
                <queryIndexField name="SU_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="pr_id_has_asc_idx">
          <fields>
                <queryIndexField name="PR_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_has_OW_a">
  <fields>
        <queryField name="PR_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="OW_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="ow_id_a_asc_idx">
          <fields>
                <queryIndexField name="OW_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="pr_id_has_asc_idx">
          <fields>
                <queryIndexField name="PR_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PE_has_OW_a">
  <fields>
        <queryField name="PE_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="OW_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="pe_id_has_asc_idx">
          <fields>
                <queryIndexField name="PE_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="ow_id_a_asc_idx">
          <fields>
                <queryIndexField name="OW_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_has_AS_a">
  <fields>
        <queryField name="PR_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="AS_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="as_id_a_asc_idx">
          <fields>
                <queryIndexField name="AS_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="pr_id_has_asc_idx">
          <fields>
                <queryIndexField name="PR_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PO_has_RO_a">
  <fields>
        <queryField name="PO_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="RO_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="po_id_has_asc_idx">
          <fields>
                <queryIndexField name="PO_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="ro_id_a_asc_idx">
          <fields>
                <queryIndexField name="RO_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="AS_has_RO_a">
  <fields>
        <queryField name="AS_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="RO_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="as_id_has_asc_idx">
          <fields>
                <queryIndexField name="AS_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="ro_id_a_asc_idx">
          <fields>
                <queryIndexField name="RO_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PO_has_PE_a">
  <fields>
        <queryField name="PO_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="PE_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="po_id_has_asc_idx">
          <fields>
                <queryIndexField name="PO_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="pe_id_a_asc_idx">
          <fields>
                <queryIndexField name="PE_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="AS_has_FT_a">
  <fields>
        <queryField name="AS_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="FT_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="as_id_has_asc_idx">
          <fields>
                <queryIndexField name="AS_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="ft_id_a_asc_idx">
          <fields>
                <queryIndexField name="FT_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="MI_has_DE_a">
  <fields>
        <queryField name="MI_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="DE_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="mi_id_has_asc_idx">
          <fields>
                <queryIndexField name="MI_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="de_id_a_asc_idx">
          <fields>
                <queryIndexField name="DE_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="FT_has_SU_a">
  <fields>
        <queryField name="FT_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SU_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="su_id_a_asc_idx">
          <fields>
                <queryIndexField name="SU_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="ft_id_has_asc_idx">
          <fields>
                <queryIndexField name="FT_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="DE_has_SU_a">
  <fields>
        <queryField name="DE_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SU_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="su_id_a_asc_idx">
          <fields>
                <queryIndexField name="SU_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="de_id_has_asc_idx">
          <fields>
                <queryIndexField name="DE_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SU_has_SE_a">
  <fields>
        <queryField name="SU_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SE_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="se_id_a_asc_idx">
          <fields>
                <queryIndexField name="SE_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="su_id_has_asc_idx">
          <fields>
                <queryIndexField name="SU_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SE_has_ER_a">
  <fields>
        <queryField name="SE_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="ER_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="er_id_a_asc_idx">
          <fields>
                <queryIndexField name="ER_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="se_id_has_asc_idx">
          <fields>
                <queryIndexField name="SE_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="ER_has_RV_a">
  <fields>
        <queryField name="ER_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="RV_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="rv_id_a_asc_idx">
          <fields>
                <queryIndexField name="RV_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="er_id_has_asc_idx">
          <fields>
                <queryIndexField name="ER_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="RV_has_IN_a">
  <fields>
        <queryField name="RV_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="IN_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="rv_id_has_asc_idx">
          <fields>
                <queryIndexField name="RV_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="in_id_a_asc_idx">
          <fields>
                <queryIndexField name="IN_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="RV_has_VI_a">
  <fields>
        <queryField name="RV_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="VI_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="rv_id_has_asc_idx">
          <fields>
                <queryIndexField name="RV_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="vi_id_a_asc_idx">
          <fields>
                <queryIndexField name="VI_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="MI_has_SS_a">
  <fields>
        <queryField name="MI_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SS_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="ss_id_a_asc_idx">
          <fields>
                <queryIndexField name="SS_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="mi_id_has_asc_idx">
          <fields>
                <queryIndexField name="MI_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SS_has_ER_a">
  <fields>
        <queryField name="SS_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="ER_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="er_id_a_asc_idx">
          <fields>
                <queryIndexField name="ER_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="ss_id_has_asc_idx">
          <fields>
                <queryIndexField name="SS_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="PR_has_IS_a">
  <fields>
        <queryField name="PR_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="IS_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="is_id_a_asc_idx">
          <fields>
                <queryIndexField name="IS_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="pr_id_has_asc_idx">
          <fields>
                <queryIndexField name="PR_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="RV_has_BU_a">
  <fields>
        <queryField name="RV_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="BU_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="rv_id_has_asc_idx">
          <fields>
                <queryIndexField name="RV_Id_has" />
          </fields>
        </queryIndex>
        <queryIndex name="bu_id_a_asc_idx">
          <fields>
                <queryIndexField name="BU_Id_a" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="BU_has_SI_a">
  <fields>
        <queryField name="BU_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SI_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="si_id_a_asc_idx">
          <fields>
                <queryIndexField name="SI_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="bu_id_has_asc_idx">
          <fields>
                <queryIndexField name="BU_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="SI_has_NE_a">
  <fields>
        <queryField name="SI_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="NE_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="ne_id_a_asc_idx">
          <fields>
                <queryIndexField name="NE_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="si_id_has_asc_idx">
          <fields>
                <queryIndexField name="SI_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="UI_has_SI_a">
  <fields>
        <queryField name="UI_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="SI_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="si_id_a_asc_idx">
          <fields>
                <queryIndexField name="SI_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="ui_id_has_asc_idx">
          <fields>
                <queryIndexField name="UI_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="US_has_UI_a">
  <fields>
        <queryField name="US_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="UI_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="ui_id_a_asc_idx">
          <fields>
                <queryIndexField name="UI_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="us_id_has_asc_idx">
          <fields>
                <queryIndexField name="US_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="IS_has_US_a">
  <fields>
        <queryField name="IS_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="US_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="us_id_a_asc_idx">
          <fields>
                <queryIndexField name="US_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="is_id_has_asc_idx">
          <fields>
                <queryIndexField name="IS_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
<queryEntity keyTypeName="java.lang.Long" keyType="System.Int64" 
valueTypeName="US_has_ES_a">
  <fields>
        <queryField name="US_Id_has" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
        <queryField name="ES_Id_a" fieldType="System.Int64" 
fieldTypeName="java.lang.Long" />
  </fields>
  <indexes>
        <queryIndex name="es_id_a_asc_idx">
          <fields>
                <queryIndexField name="ES_Id_a" />
          </fields>
        </queryIndex>
        <queryIndex name="us_id_has_asc_idx">
          <fields>
                <queryIndexField name="US_Id_has" />
          </fields>
        </queryIndex>
  </indexes>
</queryEntity>
</queryEntities>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to