Package oracle.jbo

Examples of oracle.jbo.RowSetIterator


        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.
View Full Code Here

TOP

Related Classes of oracle.jbo.RowSetIterator

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.