/** * INTERNAL: * Called by CursoredStream to construct objects from rows. * Subclasses which build other results objects (ReportQuery, & PartialObjects) may override */ public Object buildObject(AbstractRecord row) { return getDescriptor().getObjectBuilder().buildObject(this, row, this.getJoinedAttributeManager()); }
original = buildObjectInUnitOfWork(query, joinManager, databaseRow, (UnitOfWorkImpl)session, primaryKey, concreteDescriptor); } else { original = buildObject(query, databaseRow, session, primaryKey, concreteDescriptor, joinManager);
domainObject = buildObject(query, databaseRow, session, primaryKey, concreteDescriptor, joinManager);
/** * Return a container which contains the instances of the receivers javaClass. * Set the fields of the instance to the values stored in the database rows. */ public Object buildObjectsInto(ReadAllQuery query, Vector databaseRows, Object domainObjects) throws DatabaseException { Set identitySet = null; for (Enumeration rowsEnum = databaseRows.elements(); rowsEnum.hasMoreElements();) { AbstractRecord databaseRow = (AbstractRecord)rowsEnum.nextElement(); // Skip null rows from 1-m joining duplicate row filtering. if (databaseRow != null) { Object domainObject = buildObject(query, databaseRow, query.getJoinedAttributeManager()); // Avoid duplicates if -m joining was used and a cache hit occured. if (query.getJoinedAttributeManager().isToManyJoin()) { if (identitySet == null) { identitySet = new TopLinkIdentityHashSet(databaseRows.size()); } if (!identitySet.contains(domainObject)) { identitySet.add(domainObject); query.getContainerPolicy().addInto(domainObject, domainObjects, query.getSession()); } } else { query.getContainerPolicy().addInto(domainObject, domainObjects, query.getSession()); } } } return domainObjects; }
Vector trimedValues = Helper.copyVector(row.getValues(), item.getResultIndex(), row.size()); AbstractRecord subRow = new DatabaseRecord(trimedFields, trimedValues); value = item.getDescriptor().getObjectBuilder().buildObject(query, subRow, joinManager);
return descriptor.getObjectBuilder().buildObject(query, entityRecord, new JoinedAttributeManager(descriptor, (ExpressionBuilder)null, query));
Object targetObject = getReferenceDescriptor().getObjectBuilder().buildObject(nestedQuery, targetRow, nestedQuery.getJoinedAttributeManager()); nestedQuery.setTranslationRow(null); getContainerPolicy().addInto(targetObject, value, executionSession);
referenceObject = this.referenceDescriptor.getObjectBuilder().buildObject(nestedQuery, targetRow, nestedQuery.getJoinedAttributeManager());