Package Express.services

Examples of Express.services.BusinessQuery


    public TextData getModeText() {
        return this.modeText;
    }

    public void setRecordTemplate(BusinessQuery recordTemplate) {
        BusinessQuery oldValue = this.recordTemplate;
        this.recordTemplate = recordTemplate;
        this.qq_Listeners.firePropertyChange("recordTemplate", oldValue, this.recordTemplate);
    }
View Full Code Here


                if (this.getWindowInfo().getParentWindow() != null) {
                    currec = this.getWindowInfo().getParentWindow().getCurRec();
                }

                if ((this.getWindowInfo().getDataToDisplay() == ExpressClassWindow.DD_ASSOCIATED_RECORD) && currec != null) {
                    BusinessQuery qry = currec.newQuery();
                    Array_Of_QueryAttrMap<QueryAttrMap> fks = qry.getForeignAttrMap(this.getWindowInfo().getAssocNum());
                    if (fks != null && fks.size() > 0 && fks.get(0).getLocal() == 1) {
                        //
                        // Record class contains a foreign key that references primary key
                        // in 'currec' class (Primary keys always begin at ATTR_ number=1).
                        //
View Full Code Here

        DataValue fromValue = null;
        DataValue toValue = null;
        boolean didCopy = false;

        BusinessQuery tmpQry = fromRecord.newQuery();
        int lastDBAttr = tmpQry.getNumAttrs(BusinessQuery.ATTR_DB);

        for (int i = 1; i <= tmpQry.getNumAttrs(BusinessQuery.ATTR_SIMPLE); i++) {
            toValue = toRecord.getAttr(i);
            fromValue = fromRecord.getAttr(i);

            if ((toValue != null && fromValue != null && StringUtils.notEquals(toValue.getTextValue().toString(), fromValue.getTextValue().toString())) || (toValue == null && setIfNil)) {
View Full Code Here

            }
            else {
                //
                // get a record template for the current window.
                //
                BusinessQuery criteria = this.getRecordTemplate();
                criteria.clearConstraints(false);

                //
                // store original criteria before changing it.
                //
                BusinessQuery previousCriteria = criteria.getQuery(assocNum);

                //
                // Minimize the number of queries we need to run.
                // Temporarily remove the old criteria from other associations.
                //
                Array_Of_BusinessQuery<BusinessQuery> tmpForeignClasses = criteria.getForeignClasses();
                criteria.setForeignClasses(null);

                //
                // Request the linked window's data. Merge the current criteria
                // for businessClass 'AssocNum' with that found in 'template'.
                //
                criteria.addAttr(assocNum, template);
                if (previousCriteria != null) {
                    criteria.addAttr(assocNum, previousCriteria);
                    // merge
                }

                if (this.getRecordIndex() != null && this.getCurRec() != null && this.getCurRec().getInstanceKey() != null) {
                    //
                    // Add keys for current record so will reselect this record.
                    //
                    for (int i = 1; i <= this.getRecordTemplate().getNumKeyAttrs(); i++) {
                        criteria.addConstraint(i, ConstraintOperation.OP_EQ, this.getCurRec().getInstanceKey().getValues().get(i-1));
                    }

                    //
                    // find the record (and it's associated records)
                    //
                    try {
                        if (this.getBusinessClient().transActive()) {
                            newData = this.getBusinessClient().select(criteria, ConcurrencyMgr.TR_CONTINUE);
                        }
                        else {
                            newData = this.getBusinessClient().select(criteria, ConcurrencyMgr.TR_START);
                        }
                        //
                        // restore original criteria for foreign classes
                        //
                    }
                    catch (Throwable qq_ElseException) {
                        criteria.setForeignClasses(tmpForeignClasses);
                       
                        throw (RuntimeException)qq_ElseException;
                    }
                }

                //
                // replace the given records with the fully fetched records
                //
                data.clear();
                if (newData != null && newData.get(0) != null) {
                    if ((criteria.getForeignAttrMult(assocNum)&BusinessQuery.ASSOC_MULT_TO_MANY) > 0) {
                        Array_Of_BusinessClass<BusinessClass> a = null;
                        // ------------------------------
                        // Parameters for call to GetAttr
                        // ------------------------------
                        ParameterHolder_BusinessClass_Array qq_value = new ParameterHolder_BusinessClass_Array();
                        newData.get(0).getAttr(assocNum, qq_value);
                        a = (Array_Of_BusinessClass<BusinessClass>)qq_value.getObject();
                        if (a != null) {
                            for (BusinessClass rec : a) {
                                data.add(rec);
                            }
                        }

                    }
                    else {
                        BusinessClass b = null;
                        // ------------------------------
                        // Parameters for call to GetAttr
                        // ------------------------------
                        ParameterHolder_BusinessClass qq_value = new ParameterHolder_BusinessClass();
                        newData.get(0).getAttr(assocNum, qq_value);
                        b = (BusinessClass)qq_value.getObject();
                        // bug 37299 c : BusinessClass;
                        // bug 37299 GetCurRec().GetAttr(AssocNum, c );
                        // bug 37299 if c = NIL then
                        this.getCurRec().setAttr(assocNum, b);
                        // bug 37299 end if;
                        data.add(b);
                    }
                }

                //
                // restore original criteria
                //
                criteria.setForeignClasses(tmpForeignClasses);
            }

            //
            // if this window does not have access to a manager, pass
            // this request for dependent data to its parent.
            //
        }
        else {
            if (assocNum == 0) {
                if (LogMgr.getInstance().test(Framework.Constants.SP_MT_DEBUG, Framework.Constants.SP_ST_EX, 30, 110)) {
                    Logger.getLogger("task.part.logmgr").info(this.getWindowName());
                    Logger.getLogger("task.part.logmgr").info(".GetDependentData2: calling ");
                    Logger.getLogger("task.part.logmgr").info(this.getWindowInfo().getParentWindow().getWindowName());
                    Logger.getLogger("task.part.logmgr").info(".GetDependentData");
                }
                data = this.getWindowInfo().getParentWindow().getDependentData(data, template, this.getWindowInfo().getAssocNum());
            }
            else {
                newData = new Array_Of_BusinessClass<BusinessClass>();
                newData.set(0, this.getCurRec());
                //
                // Clone this window's current record so we don't modify the
                // actual current record when it gets passed to GetDependentData
                // below.
                //
                if (newData.get(0) != null) {
                    if (LogMgr.getInstance().test(Framework.Constants.SP_MT_DEBUG, Framework.Constants.SP_ST_EX, 30, 110)) {
                        Logger.getLogger("task.part.logmgr").info(this.getWindowName());
                        Logger.getLogger("task.part.logmgr").info(".GetDependentData: doing newData[1].Clone()");
                    }

                    newData.set(0, CloneHelper.clone(newData.get(0), false));
                    //
                    // Also clone the to-many (array) reference attributes.
                    //
                    for (int i = 1; i <= this.getRecordTemplate().getNumAttrs(BusinessQuery.ATTR_FOREIGN); i++) {
                        if ((this.getRecordTemplate().getForeignAttrMult(i+10000)&BusinessQuery.ASSOC_MULT_TO_MANY) > 0) {
                            Array_Of_BusinessClass<BusinessClass> tmpAry = null;
                            // ------------------------------
                            // Parameters for call to GetAttr
                            // ------------------------------
                            ParameterHolder_BusinessClass_Array qq_value = new ParameterHolder_BusinessClass_Array();
                            newData.get(0).getAttr(i+10000, qq_value);
                            tmpAry = (Array_Of_BusinessClass<BusinessClass>)qq_value.getObject();
                            if (tmpAry != null) {
                                tmpAry = CloneHelper.clone(tmpAry, false);
                                newData.get(0).setAttr(i+10000, tmpAry);
                            }
                        }
                    }
                }

                //
                // As long as the current record in this window has not been
                // recently inserted, pass it to its parent to see if the
                // parent can find the missing columns.
                //
                if (newData.get(0) != null && newData.get(0).getInstanceStatus() != BusinessClass.ST_INSERT && newData.get(0).getInstanceStatus() != BusinessClass.ST_EMPTY) {
                    BusinessQuery criteria = this.getRecordTemplate();
                    criteria.clearConstraints(false);
                    BusinessClass curRec = newData.get(0);

                    //
                    // store original criteria before changing it.
                    //
                    BusinessQuery previousCriteria = criteria.getQuery(assocNum);

                    //
                    // Minimize the number of queries we need to run.
                    // Temporarily remove the old criteria from other associations.
                    //
View Full Code Here

                // ------------------------------
                ParameterHolder_BusinessClass qq_value = new ParameterHolder_BusinessClass();
                record.getAttr(i+10000, qq_value);
                rec = (BusinessClass)qq_value.getObject();
                if (rec != null) {
                    BusinessQuery temp = template.getQuery(i+10000);

                    this.initializeDates(rec, temp);
                }
            }
        }
View Full Code Here

    public int getDataToDisplay() {
        return this.dataToDisplay;
    }

    public void setInitialSearch(BusinessQuery initialSearch) {
        BusinessQuery oldValue = this.initialSearch;
        this.initialSearch = initialSearch;
        this.qq_Listeners.firePropertyChange("initialSearch", oldValue, this.initialSearch);
    }
View Full Code Here

    public TextData getModeText() {
        return this.modeText;
    }

    public void setRecordTemplate(BusinessQuery recordTemplate) {
        BusinessQuery oldValue = this.recordTemplate;
        this.recordTemplate = recordTemplate;
        this.qq_Listeners.firePropertyChange("recordTemplate", oldValue, this.recordTemplate);
    }
View Full Code Here

                if (this.getWindowInfo().getParentWindow() != null) {
                    currec = this.getWindowInfo().getParentWindow().getCurRec();
                }

                if ((this.getWindowInfo().getDataToDisplay() == ExpressClassWindow.DD_ASSOCIATED_RECORD) && currec != null) {
                    BusinessQuery qry = currec.newQuery();
                    Array_Of_QueryAttrMap<QueryAttrMap> fks = qry.getForeignAttrMap(this.getWindowInfo().getAssocNum());
                    if (fks != null && fks.size() > 0 && fks.get(0).getLocal() == 1) {
                        //
                        // Record class contains a foreign key that references primary key
                        // in 'currec' class (Primary keys always begin at ATTR_ number=1).
                        //
View Full Code Here

        DataValue fromValue = null;
        DataValue toValue = null;
        boolean didCopy = false;

        BusinessQuery tmpQry = fromRecord.newQuery();
        int lastDBAttr = tmpQry.getNumAttrs(BusinessQuery.ATTR_DB);

        for (int i = 1; i <= tmpQry.getNumAttrs(BusinessQuery.ATTR_SIMPLE); i++) {
            toValue = toRecord.getAttr(i);
            fromValue = fromRecord.getAttr(i);

            if ((toValue != null && fromValue != null && StringUtils.notEquals(toValue.getTextValue().toString(), fromValue.getTextValue().toString())) || (toValue == null && setIfNil)) {
View Full Code Here

            }
            else {
                //
                // get a record template for the current window.
                //
                BusinessQuery criteria = this.getRecordTemplate();
                criteria.clearConstraints(false);

                //
                // store original criteria before changing it.
                //
                BusinessQuery previousCriteria = criteria.getQuery(assocNum);

                //
                // Minimize the number of queries we need to run.
                // Temporarily remove the old criteria from other associations.
                //
                Array_Of_BusinessQuery<BusinessQuery> tmpForeignClasses = criteria.getForeignClasses();
                criteria.setForeignClasses(null);

                //
                // Request the linked window's data. Merge the current criteria
                // for businessClass 'AssocNum' with that found in 'template'.
                //
                criteria.addAttr(assocNum, template);
                if (previousCriteria != null) {
                    criteria.addAttr(assocNum, previousCriteria);
                    // merge
                }

                if (this.getRecordIndex() != null && this.getCurRec() != null && this.getCurRec().getInstanceKey() != null) {
                    //
                    // Add keys for current record so will reselect this record.
                    //
                    for (int i = 1; i <= this.getRecordTemplate().getNumKeyAttrs(); i++) {
                        criteria.addConstraint(i, ConstraintOperation.OP_EQ, this.getCurRec().getInstanceKey().getValues().get(i-1));
                    }

                    //
                    // find the record (and it's associated records)
                    //
                    try {
                        if (this.getBusinessClient().transActive()) {
                            newData = this.getBusinessClient().select(criteria, ConcurrencyMgr.TR_CONTINUE);
                        }
                        else {
                            newData = this.getBusinessClient().select(criteria, ConcurrencyMgr.TR_START);
                        }
                        //
                        // restore original criteria for foreign classes
                        //
                    }
                    catch (Throwable qq_ElseException) {
                        criteria.setForeignClasses(tmpForeignClasses);
                       
                        throw (RuntimeException)qq_ElseException;
                    }
                }

                //
                // replace the given records with the fully fetched records
                //
                data.clear();
                if (newData != null && newData.get(0) != null) {
                    if ((criteria.getForeignAttrMult(assocNum)&BusinessQuery.ASSOC_MULT_TO_MANY) > 0) {
                        Array_Of_BusinessClass<BusinessClass> a = null;
                        // ------------------------------
                        // Parameters for call to GetAttr
                        // ------------------------------
                        ParameterHolder_BusinessClass_Array qq_value = new ParameterHolder_BusinessClass_Array();
                        newData.get(0).getAttr(assocNum, qq_value);
                        a = (Array_Of_BusinessClass<BusinessClass>)qq_value.getObject();
                        if (a != null) {
                            for (BusinessClass rec : a) {
                                data.add(rec);
                            }
                        }

                    }
                    else {
                        BusinessClass b = null;
                        // ------------------------------
                        // Parameters for call to GetAttr
                        // ------------------------------
                        ParameterHolder_BusinessClass qq_value = new ParameterHolder_BusinessClass();
                        newData.get(0).getAttr(assocNum, qq_value);
                        b = (BusinessClass)qq_value.getObject();
                        // bug 37299 c : BusinessClass;
                        // bug 37299 GetCurRec().GetAttr(AssocNum, c );
                        // bug 37299 if c = NIL then
                        this.getCurRec().setAttr(assocNum, b);
                        // bug 37299 end if;
                        data.add(b);
                    }
                }

                //
                // restore original criteria
                //
                criteria.setForeignClasses(tmpForeignClasses);
            }

            //
            // if this window does not have access to a manager, pass
            // this request for dependent data to its parent.
            //
        }
        else {
            if (assocNum == 0) {
                if (LogMgr.getInstance().test(Framework.Constants.SP_MT_DEBUG, Framework.Constants.SP_ST_EX, 30, 110)) {
                    Logger.getLogger("task.part.logmgr").info(this.getWindowName());
                    Logger.getLogger("task.part.logmgr").info(".GetDependentData2: calling ");
                    Logger.getLogger("task.part.logmgr").info(this.getWindowInfo().getParentWindow().getWindowName());
                    Logger.getLogger("task.part.logmgr").info(".GetDependentData");
                }
                data = this.getWindowInfo().getParentWindow().getDependentData(data, template, this.getWindowInfo().getAssocNum());
            }
            else {
                newData = new Array_Of_BusinessClass<BusinessClass>();
                newData.set(0, this.getCurRec());
                //
                // Clone this window's current record so we don't modify the
                // actual current record when it gets passed to GetDependentData
                // below.
                //
                if (newData.get(0) != null) {
                    if (LogMgr.getInstance().test(Framework.Constants.SP_MT_DEBUG, Framework.Constants.SP_ST_EX, 30, 110)) {
                        Logger.getLogger("task.part.logmgr").info(this.getWindowName());
                        Logger.getLogger("task.part.logmgr").info(".GetDependentData: doing newData[1].Clone()");
                    }

                    newData.set(0, CloneHelper.clone(newData.get(0), false));
                    //
                    // Also clone the to-many (array) reference attributes.
                    //
                    for (int i = 1; i <= this.getRecordTemplate().getNumAttrs(BusinessQuery.ATTR_FOREIGN); i++) {
                        if ((this.getRecordTemplate().getForeignAttrMult(i+10000)&BusinessQuery.ASSOC_MULT_TO_MANY) > 0) {
                            Array_Of_BusinessClass<BusinessClass> tmpAry = null;
                            // ------------------------------
                            // Parameters for call to GetAttr
                            // ------------------------------
                            ParameterHolder_BusinessClass_Array qq_value = new ParameterHolder_BusinessClass_Array();
                            newData.get(0).getAttr(i+10000, qq_value);
                            tmpAry = (Array_Of_BusinessClass<BusinessClass>)qq_value.getObject();
                            if (tmpAry != null) {
                                tmpAry = CloneHelper.clone(tmpAry, false);
                                newData.get(0).setAttr(i+10000, tmpAry);
                            }
                        }
                    }
                }

                //
                // As long as the current record in this window has not been
                // recently inserted, pass it to its parent to see if the
                // parent can find the missing columns.
                //
                if (newData.get(0) != null && newData.get(0).getInstanceStatus() != BusinessClass.ST_INSERT && newData.get(0).getInstanceStatus() != BusinessClass.ST_EMPTY) {
                    BusinessQuery criteria = this.getRecordTemplate();
                    criteria.clearConstraints(false);
                    BusinessClass curRec = newData.get(0);

                    //
                    // store original criteria before changing it.
                    //
                    BusinessQuery previousCriteria = criteria.getQuery(assocNum);

                    //
                    // Minimize the number of queries we need to run.
                    // Temporarily remove the old criteria from other associations.
                    //
View Full Code Here

TOP

Related Classes of Express.services.BusinessQuery

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.