Full resultset audit queries

- Use RollupRowHandler and nested ResultMap
 - Audit Map values are pulled back with entries


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16130 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-09-07 15:48:00 +00:00
parent a6eb590cc9
commit fadc101ce4
6 changed files with 87 additions and 49 deletions

View File

@@ -833,7 +833,7 @@ public abstract class AbstractPropertyValueDAOImpl implements PropertyValueDAO
protected abstract PropertyValueEntity createPropertyValue(Serializable value);
@SuppressWarnings("unchecked")
protected Serializable convertPropertyIdSearchRows(List<PropertyIdSearchRow> rows)
public Serializable convertPropertyIdSearchRows(List<PropertyIdSearchRow> rows)
{
/*
* The results are ordered by the root_prop_id, current_prop_id and value_prop_id.
@@ -843,8 +843,21 @@ public abstract class AbstractPropertyValueDAOImpl implements PropertyValueDAO
final Map<Long, Serializable> values = new HashMap<Long, Serializable>(rows.size());
List<PropertyLinkEntity> keyRows = new ArrayList<PropertyLinkEntity>(5);
Serializable result = null;
Long rootPropId = null;
for (PropertyIdSearchRow row : rows)
{
// Check that we are handling a single root property
if (rootPropId == null)
{
rootPropId = row.getLinkEntity().getRootPropId();
}
else if (!rootPropId.equals(row.getLinkEntity().getRootPropId()))
{
throw new IllegalArgumentException(
"The root_prop_id for the property search rows must not change: \n" +
" Rows: " + rows);
}
PropertyLinkEntity linkEntity = row.getLinkEntity();
PropertyValueEntity valueEntity = row.getValueEntity();
// Construct the value (Maps and Collections should be CONSTRUCTABLE)