Package Framework

Examples of Framework.DataValue


   * The parameters can be IntegerData or TextData. The calling method must cast the result into the appropriate class type.
   * @param parameterName
   * @return
   */
  public Object getParameter(String parameterName) {
    DataValue item = (DataValue)this.table.find(parameterName);
    if (item == null) {
      UsageException errorVar = new UsageException("Error retrieving value for parameter named " + parameterName + ". No such parameter exists in the current ParameterList.");
      ErrorMgr.addError(errorVar);
      throw errorVar;
    }
View Full Code Here


            //  0 < attr < ATTR_FOREIGN is true, which means that it is a regular simple
            //  attribute.  Get it and add a constraint which will modify the value in
            //  the Database.  Note:  The constraint on a query for update is used to
            //  specify the columns to update and their values.

            DataValue myValue = null;

            myValue = source.getAttr(attr);

            if (myValue == null) {
                myValue = source.newAttr(attr);
View Full Code Here

            if (source.getUpdateQuery() == null) {
                BusinessQuery updateQuery = source.newQuery();
                updateQuery.setOriginalClass(CloneHelper.clone(source, false));
                source.setUpdateQuery(updateQuery);
                DataValue val = null;
                for (int i = 1; i <= source.getUpdateQuery().getNumAttrs(); i++) {
                    val = source.getAttr(i);
                    if (val != null) {
                        source.getUpdateQuery().getOriginalClass().setAttr(i, CloneHelper.clone(val, true));
                    }
View Full Code Here

     * <p>
     * @param query Type: BusinessQuery
     * @param source Type: BusinessClass
     */
    private void addConstraints(BusinessQuery query, BusinessClass source) {
        DataValue value = null;

        for (int j = query.getNumKeyAttrs()+1; j <= query.getNumAttrs(); j++) {

            value = source.getAttr(j);

View Full Code Here

        BusinessClass foreignClass = null;
        Array_Of_BusinessClass<BusinessClass> foreignClasses = null;
        int mult = 0;
        Array_Of_BusinessClass<BusinessClass> referenceClasses = null;
        DataValue value = null;

        mult = referenceQuery.getForeignAttrMult(attr);

        if ((mult&BusinessQuery.ASSOC_AGGREGATION) == 0) {
            return;
View Full Code Here

            //   For Sybase we cannot verify the class by adding constraints if there
            //  are any BLOB columns.
            //
            if (((BusinessDBMgr)this.getParentService().getMgr(query)).getDB().getDBVendorType() == Constants.DB_VT_SYBASE) {

                DataValue value1 = null;
                int dtype = 0;

                for (int j = query.getNumKeyAttrs()+1; j <= query.getNumAttrs(); j++) {
                    value1 = query.getOriginalClass().getAttr(j);
                    if (value1 != null) {
                        dtype = value1.dataType()&127;
                        if (dtype == 8 || dtype == 9 || (dtype == 6 && value1 instanceof LongTextDomain)) {
                            verifyByQuery = true;
                            break;
                        }
                    }
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setValue(DataValue value) {
        DataValue oldValue = this.value;
        this.value = value;
        this.qq_Listeners.firePropertyChange("value", oldValue, this.value);
    }
View Full Code Here

            }
        }

        if (!(oneQuery)) {

            DataValue val = null;

            if (result != null) {
                ProcessResult:
                for (BusinessClass entity : result) {
View Full Code Here

     * @param value Type: DataValue
     * @param type Type: DataValue
     * @param templateText Type: TextData (Input) (default in Forte: NIL)
     */
    public void addConstraint(int attr, DataValue value, DataValue type, TextData templateText) {
        DataValue kind = null;

        if (attr > this.getNumAttrs()) {

            throw new Error(Error.BQ_ILLEGAL_ATTR, "AddConstraint", this, new IntegerData(attr), Error.qq_Resolver.cERROR_METHODNAME_ORIGINATOR_PARAM1).getException();

        }
        else if (type == null || !(value instanceof TextData)) {

            // no need to parse or do SetValue() on "value".
            this.addConstraint(attr, ConstraintOperation.OP_EQ, value);

        }
        else if (type instanceof TextData) {

            TextData v = (TextData)value;
            v.setOffset(0);

            if (v.moveToChar("%_")) {
                this.addConstraint(attr, ConstraintOperation.OP_LIKE, value);
            }
            else if (v.getActualSize() == 4 && v.moveToString("NULL", false, true)) {
                this.addConstraint(attr, ConstraintOperation.OP_NULL, (DataValue)null);
            }
            else {
                this.addConstraint(attr, ConstraintOperation.OP_EQ, value);
            }

        }
        else if (!(type instanceof NumericData) && !(type instanceof DateTimeData)) {

            kind = CloneHelper.clone(type, false);
            kind.setValue(value);
            this.addConstraint(attr, ConstraintOperation.OP_EQ, kind);

        }
        else {

View Full Code Here

     * @param level Type: int (Input) (default in Forte: 0)
     * @return TextData
     */
    @SuppressWarnings("unchecked")
  public TextData fillString(int level) {
        DataValue attr = null;
        BusinessQuery query = null;
        TextData indent = new TextData("\n");
        TextData result = new TextData();

        for (int i = 1; i <= level; i++) {
            indent.concat("   ");
            result.concat("   ");
        }

        query = this.newQuery();
        query.setOperation(BusinessQuery.OP_INSERT, (BusinessKey)null);
        SqlQuery sqlQuery = new SqlQuery(BusinessQuery.OP_INSERT);
        query.describeTables(sqlQuery);
        result.concat(this.getClass().getSimpleName());
        result.concat(": Status = ");
        result.concat(this.statusAsTextData());
        result.concat(", Key = ");
        if (this.getInstanceKey() == null) {
            result.concat("<NIL>");
        }
        else {
            result.concat(this.getInstanceKey().asTextData());
        }

        for (int j = 1; j <= query.getNumAttrs(); j++) {
            result.concat(indent);
            attr = this.getAttr(j);
            result.concat("Attribute ");
            result.concat(j);
            result.concat(" (");
            result.concat(query.getAttrName(j));
            result.concat(") = ");
            if (attr == null) {
                result.concat("<NIL>");
            }
            else if (attr.getIsNull()) {
                result.concat("<NULL>");
            }
            else if (attr instanceof DoubleData && ((DoubleData)attr).getValue() < 1e+012 && ((DoubleData)attr).getValue() > 1e-012) {
                result.concat(new NumericFormat(new TextData("#.############"), NumericFormat.qq_Resolver.cTEMPLATE).formatNumeric((DoubleData)attr));
            }
View Full Code Here

TOP

Related Classes of Framework.DataValue

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.