Package oracle.jbo

Examples of oracle.jbo.ViewObject


        if (autoCrit.getOperator().getOperandCount() != 1) {
            throw new IllegalArgumentException("autoComplete needs an attribuut with as default operator a single-value.");
        }
        critVals.set(0, value);
        performQuery(queryDescriptor);
        final ViewObject vo = tableModel.getViewOject();
        logger.fine("autoComplete found {0} row(s).", vo.getRowCount());
        if (vo.getRowCount() == 1) { // If we find 1 row, return this.
            final Object row = vo.getRowAtRangeIndex(0);
            if (row instanceof Row && !(row instanceof Map)) { // Wrap as Map, because this is expected by valueSelected
                final Object rowMap = new RowMapAdapter((Row) row);
                return Collections.singletonList(rowMap);
            }
            return Collections.singletonList(row);
View Full Code Here


        // Cache for better performance by repeating the same lookup.
        if (searchVals.equals(this.lastLookupVals)) {
            return lastLookupRow;
        }
        // Iterate through the ViewObject rows to find the lookup-row.
        final ViewObject vo = getTableModel().getViewOject();
        final ViewCriteria oldCriteria = vo.getViewCriteria();
        vo.applyViewCriteria(vo.createViewCriteria());
        Map<String, Object> retval = null;
        try {
            final RowSetIterator iter = vo.createRowSetIterator("__lookup__");
            iter.setRowValidation(false);
            try {
                while (iter.hasNext()) {
                    final Row row = iter.next();
                    boolean isLookup = true;
                    // Compare the values of all the lookup attributes.
                    for (String tableAttrName : lookups.keySet()) {
                        final Object rowVal = row.getAttribute(tableAttrName);
                        final Object bindingVal = searchVals.get(tableAttrName);
                        if (!new EqualsBuilder().append(rowVal,
                                                        bindingVal).isEquals()) { // Difference found, we stop the compare.
                            isLookup = false;
                            break;
                        }
                    }
                    if (isLookup) {
                        retval = new RowMapAdapter(row) {
                            @Override
                            public Object put(final String key, final Object value) { // Ignore the put operation, because the lookup row is always
                                // read only and we don't want to put.
                                return null;
                            }
                        };
                    }
                }
            } finally {
                iter.closeRowSetIterator();
            }
        } finally {
            vo.applyViewCriteria(oldCriteria);
        }
        if (retval == null) { // Row not found.
            retval = Collections.emptyMap();
        }
        lastLookupVals = searchVals;
View Full Code Here

    public Map<String, Object> getLookup() {
        return getLovModel().getLookup();
    }

    protected ModelImpl createModel() {
        final ViewObject vo = getViewObject();
        logger.fine("creating ListOfValuesModel for {0}", vo);
        // TableModel for result-table
        final TableModelImpl resultTab = createTableModel(vo);
        // Build search criteria
        final ConjunctionCriterionImpl crits = createConjunction(resultTab);
View Full Code Here

TOP

Related Classes of oracle.jbo.ViewObject

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.