/** * selects a collection of TOption objects pre-filled with their TList objects. * * <p>This method is protected by default in order to keep the public api reasonable. You can * provide public methods for those you actually need in TOptionPeer. * * @throws TorqueException Any exceptions caught during processing will be rethrown wrapped into a * TorqueException. */ protected static List<TOption> doSelectJoinTList(Criteria criteria, Connection conn) throws TorqueException { setDbName(criteria); TOptionPeer.addSelectColumns(criteria); int offset = numColumns + 1; TListPeer.addSelectColumns(criteria); criteria.addJoin(TOptionPeer.LIST, TListPeer.OBJECTID); correctBooleans(criteria); List<Record> rows; if (conn == null) { rows = BasePeer.doSelect(criteria); } else { rows = BasePeer.doSelect(criteria, conn); } List<TOption> results = new ArrayList<TOption>(); for (int i = 0; i < rows.size(); i++) { Record row = rows.get(i); Class omClass = TOptionPeer.getOMClass(); TOption obj1 = (TOption) TOptionPeer.row2Object(row, 1, omClass); omClass = TListPeer.getOMClass(); TList obj2 = (TList) TListPeer.row2Object(row, offset, omClass); boolean newObject = true; for (int j = 0; j < results.size(); j++) { TOption temp_obj1 = results.get(j); TList temp_obj2 = (TList) temp_obj1.getTList(); if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) { newObject = false; temp_obj2.addTOption(obj1); break; } } if (newObject) { obj2.initTOptions(); obj2.addTOption(obj1); } results.add(obj1); } return results; }