ALF-9153 Get the discussions reply CQ working, via some careful mybatis collections handling, and add some tests for it

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29843 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-08-17 17:50:59 +00:00
parent 7ec7327ec4
commit 2fce262264
4 changed files with 165 additions and 28 deletions

View File

@@ -31,8 +31,7 @@ import org.alfresco.repo.domain.node.NodeEntity;
*/
public class NodeWithTargetsEntity extends NodeBackedEntity
{
private List<Long> targetIds;
private List<Long> targetAssocTypeIds;
private List<TargetAndTypeId> targets;
// Supplemental query-related parameters
private Long assocTypeId;
@@ -53,24 +52,17 @@ public class NodeWithTargetsEntity extends NodeBackedEntity
this.assocTypeId = assocTypeId;
}
public List<Long> getTargetIds()
/**
* @return Pairs of (Target Node, Assoc Type)
*/
public List<TargetAndTypeId> getTargetIds()
{
return targetIds;
return targets;
}
public void setTargetIds(List<Long> targetIds)
public void setTargets(List<TargetAndTypeId> targets)
{
this.targetIds = targetIds;
}
public List<Long> getTargetAssocTypeIds()
{
return targetAssocTypeIds;
}
public void setTargetAssocTypeIds(List<Long> targetAssocTypeIds)
{
this.targetAssocTypeIds = targetAssocTypeIds;
this.targets = targets;
}
/**
@@ -81,4 +73,26 @@ public class NodeWithTargetsEntity extends NodeBackedEntity
{
return assocTypeId;
}
public static class TargetAndTypeId
{
private final Long targetId;
private final Long assocTypeId;
public TargetAndTypeId(Long targetId, Long assocTypeId)
{
this.targetId = targetId;
this.assocTypeId = assocTypeId;
}
public Long getTargetId()
{
return targetId;
}
public Long getAssocTypeId()
{
return assocTypeId;
}
}
}