// *defined at base condition-bean per table
        //  o xsetupForColumnQuery()
        //  o xsetupForVaryingUpdate()

        protected void xinheritSubQueryInfo(ConditionQuery mainCQ)
        {
            if (mainCQ.xgetSqlClause().isForSubQuery())
            {
                this.SqlClause.setupForSubQuery(mainCQ.xgetSqlClause().getSubQueryLevel()); // inherited
            }
        }
Example #2
0
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 public Mst画面マスタCIQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel, BsMst画面マスタCQ myCQ)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
     _myCQ = myCQ;
     _foreignPropertyName = _myCQ.xgetForeignPropertyName(); // Accept foreign property name.
     _relationPath        = _myCQ.xgetRelationPath();        // Accept relation path.
 }
Example #3
0
        public override void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper)
        {
            Mst画面マスタCQ baseQuery  = (Mst画面マスタCQ)baseQueryAsSuper;
            Mst画面マスタCQ unionQuery = (Mst画面マスタCQ)unionQueryAsSuper;

            if (baseQuery.hasConditionQueryKbnメニュー区分())
            {
                unionQuery.QueryKbnメニュー区分().reflectRelationOnUnionQuery(baseQuery.QueryKbnメニュー区分(), unionQuery.QueryKbnメニュー区分());
            }
        }
        public override void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper)
        {
            Dch宿泊利用台帳CQ baseQuery  = (Dch宿泊利用台帳CQ)baseQueryAsSuper;
            Dch宿泊利用台帳CQ unionQuery = (Dch宿泊利用台帳CQ)unionQueryAsSuper;

            if (baseQuery.hasConditionQueryMst会員マスタ())
            {
                unionQuery.QueryMst会員マスタ().reflectRelationOnUnionQuery(baseQuery.QueryMst会員マスタ(), unionQuery.QueryMst会員マスタ());
            }
            if (baseQuery.hasConditionQueryDch客室利用台帳())
            {
                unionQuery.QueryDch客室利用台帳().reflectRelationOnUnionQuery(baseQuery.QueryDch客室利用台帳(), unionQuery.QueryDch客室利用台帳());
            }
        }
Example #5
0
        public override void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper)
        {
            Dch従業員職位履歴台帳CQ baseQuery  = (Dch従業員職位履歴台帳CQ)baseQueryAsSuper;
            Dch従業員職位履歴台帳CQ unionQuery = (Dch従業員職位履歴台帳CQ)unionQueryAsSuper;

            if (baseQuery.hasConditionQueryMst従業員マスタ())
            {
                unionQuery.QueryMst従業員マスタ().reflectRelationOnUnionQuery(baseQuery.QueryMst従業員マスタ(), unionQuery.QueryMst従業員マスタ());
            }
            if (baseQuery.hasConditionQueryKbn職位区分())
            {
                unionQuery.QueryKbn職位区分().reflectRelationOnUnionQuery(baseQuery.QueryKbn職位区分(), unionQuery.QueryKbn職位区分());
            }
        }
Example #6
0
 public override void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper)
 {
 }
Example #7
0
 public BsDmyプロシージャCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
Example #8
0
 protected override void registerExistsSubQuery(ConditionQuery subQuery
                                                , String columnName, String relatedColumnName, String propertyName)
 {
     throw new UnsupportedOperationException("Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery.");
 }
 public void xsetupForInScopeRelation(ConditionQuery mainCQ)
 {
     xprepareSubQueryInfo(mainCQ);
     _forInScopeRelation = true;
 }
 protected virtual Dch客室利用台帳CQ xcreateCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel) {
     return new Dch客室利用台帳CQ(childQuery, sqlClause, aliasName, nestLevel);
 }
 public BsKbn客室利用区分CQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
Example #12
0
 public AbstractBsMst客室タイプマスタCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
        protected String resolveFixedConditionOverRelation(String fixedCondition)
        {
            String relationBeginMark = getRelationBeginMark();
            String relationEndMark   = getRelationEndMark();
            String remainder         = fixedCondition;

            while (true)
            {
                IndexOfInfo relationBeginIndex = Srl.indexOfFirst(remainder, relationBeginMark);
                if (relationBeginIndex == null)
                {
                    break;
                }
                remainder = relationBeginIndex.substringRear();
                IndexOfInfo relationEndIndex = Srl.indexOfFirst(remainder, relationEndMark);
                if (relationEndIndex == null)
                {
                    break;
                }

                // analyze:
                // - $$over($$localTable$$.memberStatus)$$
                // - $$over($$foreignTable$$.memberStatus, DISPLAY_ORDER)$$
                // - $$over(PURCHASE.product.productStatus)$$
                String relationExp = relationEndIndex.substringFront();
                String pointTable;
                String targetRelation;
                String secondArg;
                {
                    IndexOfInfo separatorIndex = Srl.indexOfFirst(relationExp, ".");
                    if (separatorIndex != null)
                    {
                        pointTable = separatorIndex.substringFrontTrimmed();
                        IndexOfInfo argIndex = Srl.indexOfFirst(separatorIndex.substringRearTrimmed(), ",");
                        targetRelation = argIndex != null?argIndex.substringFrontTrimmed() : separatorIndex
                                             .substringRearTrimmed();

                        secondArg = argIndex != null?argIndex.substringRearTrimmed() : null;
                    }
                    else
                    {
                        IndexOfInfo argIndex = Srl.indexOfFirst(relationExp, ",");
                        pointTable = argIndex != null?argIndex.substringFrontTrimmed() : Srl.trim(relationExp);

                        targetRelation = null;
                        secondArg      = argIndex != null?argIndex.substringRearTrimmed() : null;
                    }
                }

                ConditionQuery relationPointCQ;
                ConditionQuery columnTargetCQ;
                if (Srl.equalsPlain(pointTable, getLocalTableMark()))
                {
                    relationPointCQ = _localCQ;
                    if (targetRelation != null)
                    {
                        columnTargetCQ = invokeColumnTargetCQ(relationPointCQ, targetRelation);
                    }
                    else
                    {
                        String notice = "The relation on fixed condition is required if the table is not referrer.";
                        throwIllegalFixedConditionOverRelationException(notice, pointTable, null, fixedCondition);
                        return(null); // unreachable
                    }
                }
                else if (Srl.equalsPlain(pointTable, getForeignTableMark()))
                {
                    relationPointCQ = _foreignCQ;
                    columnTargetCQ  = relationPointCQ;
                    if (targetRelation == null)
                    {
                        String notice = "The relation on fixed condition is required if the table is not referrer.";
                        throwIllegalFixedConditionOverRelationException(notice, pointTable, null, fixedCondition);
                        return(null); // unreachable
                    }
                    // prepare fixed InlineView
                    if (_inlineViewResourceMap == null)
                    {
                        _inlineViewResourceMap = new LinkedHashMap <String, InlineViewResource>();
                    }
                    InlineViewResource resource;
                    if (_inlineViewResourceMap.containsKey(targetRelation))
                    {
                        resource = _inlineViewResourceMap.get(targetRelation);
                    }
                    else
                    {
                        resource = new InlineViewResource();
                        _inlineViewResourceMap.put(targetRelation, resource);
                    }
                    String columnName;
                    {
                        IndexOfInfo rearIndex = Srl.indexOfFirst(relationEndIndex.substringRearTrimmed(), ".");
                        if (rearIndex == null || rearIndex.getIndex() > 0)
                        {
                            String notice = "The OverRelation variable should continue to column after the variable.";
                            throwIllegalFixedConditionOverRelationException(notice, pointTable, targetRelation,
                                                                            fixedCondition);
                            return(null); // unreachable
                        }
                        String      columnStart = rearIndex.substringRear();
                        IndexOfInfo indexInfo   = Srl.indexOfFirst(columnStart, " ", ",", ")", "\n", "\t");
                        columnName = indexInfo != null?indexInfo.substringFront() : columnStart;
                    }
                    // the secondArg should be a column DB name, and then rear column is alias name
                    String resolvedColumn = secondArg != null ? secondArg + " as " + columnName : columnName;
                    resource.addAdditionalColumn(resolvedColumn);
                    List <String> splitList     = Srl.splitList(targetRelation, ".");
                    DBMeta        currentDBMeta = _dbmetaProvider.provideDBMeta(_foreignCQ.getTableDbName());
                    foreach (String element in splitList)
                    {
                        ForeignInfo foreignInfo = currentDBMeta.FindForeignInfo(element);
                        resource.addJoinInfo(foreignInfo);
                        currentDBMeta = foreignInfo.ForeignDBMeta;
                    }
                }
                else
                {
                    DBMeta pointDBMeta;
                    try {
                        pointDBMeta = _dbmetaProvider.provideDBMeta(pointTable);
                    } catch (DBMetaNotFoundException e) {
                        String notice = "The table for relation on fixed condition does not exist.";
                        throwIllegalFixedConditionOverRelationException(notice, pointTable, targetRelation, fixedCondition,
                                                                        e);
                        return(null); // unreachable
                    }
                    ConditionQuery referrerQuery = _localCQ.xgetReferrerQuery();
                    while (true)
                    {
                        if (referrerQuery == null) // means not found
                        {
                            break;
                        }
                        if (Srl.equalsPlain(pointDBMeta.TableDbName, referrerQuery.getTableDbName()))
                        {
                            break;
                        }
                        referrerQuery = referrerQuery.xgetReferrerQuery();
                    }
                    relationPointCQ = referrerQuery;
                    if (relationPointCQ == null)
                    {
                        String notice = "The table for relation on fixed condition was not found in the scope.";
                        throwIllegalFixedConditionOverRelationException(notice, pointTable, targetRelation, fixedCondition);
                        return(null); // unreachable
                    }
                    if (targetRelation != null)
                    {
                        columnTargetCQ = invokeColumnTargetCQ(relationPointCQ, targetRelation);
                    }
                    else
                    {
                        columnTargetCQ = relationPointCQ;
                    }
                }

                String relationVariable = relationBeginMark + relationExp + relationEndMark;
                String relationAlias    = columnTargetCQ.xgetAliasName();
                fixedCondition = replaceString(fixedCondition, relationVariable, relationAlias);

                // after case for loop
                remainder = relationEndIndex.substringRear();

                // for prevent from processing same one
                remainder = replaceString(remainder, relationVariable, relationAlias);
            }
            return(fixedCondition);
        }
 protected ConditionQuery invokeColumnTargetCQ(ConditionQuery relationPointCQ, String targetRelation)
 {
     return(relationPointCQ.invokeForeignCQ(targetRelation));
 }
        protected Map <String, InlineViewResource> _inlineViewResourceMap; // internal bridge container

        // ===================================================================================
        //                                                                         Constructor
        //                                                                         ===========
        public HpFixedConditionQueryResolver(ConditionQuery localCQ, ConditionQuery foreignCQ, DBMetaProvider dbmetaProvider)
        {
            _localCQ        = localCQ;
            _foreignCQ      = foreignCQ;
            _dbmetaProvider = dbmetaProvider;
        }
Example #16
0
 public AbstractBsDch客室利用台帳CQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
Example #17
0
 public BsDch従業員職位履歴台帳CQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
 public void xsetupForDerivedReferrer(ConditionQuery mainCQ)
 {
     xprepareSubQueryInfo(mainCQ);
     _forDerivedReferrer = true;
 }
 protected virtual DmyプロシージャCQ xcreateCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
 {
     return(new DmyプロシージャCQ(childQuery, sqlClause, aliasName, nestLevel));
 }
 public void xsetupForScalarCondition(ConditionQuery mainCQ)
 {
     xprepareSubQueryInfo(mainCQ);
     _forScalarCondition = true;
 }
Example #21
0
 // ===================================================================================
 //                                                             Override about Register
 //                                                             =======================
 public override void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper)
 {
     throw new UnsupportedOperationException("InlineQuery must not need UNION method: " + baseQueryAsSuper + " : " + unionQueryAsSuper);
 }
        protected void xprepareSubQueryInfo(ConditionQuery mainCQ)
        {
            int nextSubQueryLevel = mainCQ.xgetSqlClause().getSubQueryLevel() + 1;

            this.SqlClause.setupForSubQuery(nextSubQueryLevel); // incremented
        }
Example #23
0
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 // You should NOT touch with this constructor.
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="childQuery">Child query as interface. (NullAllowed: If null, this is base instance.)</param>
 /// <param name="sqlClause">SQL clause instance. (NotNull)</param>
 /// <param name="aliasName">My alias name. (NotNull)</param>
 /// <param name="nestLevel">Nest level.</param>
 public Mst権限マスタCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
     : base(childQuery, sqlClause, aliasName, nestLevel)
 {
 }
 protected virtual Mst客室タイプマスタCQ xcreateCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel)
 {
     return(new Mst客室タイプマスタCQ(childQuery, sqlClause, aliasName, nestLevel));
 }