use of org.alfresco.repo.domain.propval.PropertyIdQueryResult in project alfresco-repository by Alfresco.
the class PropertyValueDAOImpl method findPropertiesByIds.
@Override
protected void findPropertiesByIds(List<Long> ids, final PropertyFinderCallback callback) {
ResultHandler valueResultHandler = new ResultHandler() {
public void handleResult(ResultContext context) {
PropertyIdQueryResult result = (PropertyIdQueryResult) context.getResultObject();
Long id = result.getPropId();
// Make the serializable value
List<PropertyIdSearchRow> rows = result.getPropValues();
Serializable value = convertPropertyIdSearchRows(rows);
callback.handleProperty(id, value);
}
};
// A row handler to roll up individual rows
Configuration configuration = template.getConfiguration();
RollupResultHandler rollupResultHandler = new RollupResultHandler(configuration, KEY_COLUMNS_FINDBYIDS, "propValues", valueResultHandler);
// Query using the IDs
PropertyIdQueryParameter params = new PropertyIdQueryParameter();
params.setRootPropIds(ids);
template.select(SELECT_PROPERTIES_BY_IDS, params, rollupResultHandler);
// Process any remaining results
rollupResultHandler.processLastResults();
// Done
}
Aggregations