}
private OrganizationalUnitNodeWithGrant getNodeWithGrants(
OrganizationalUnitNode node, Integer grantId, Session aSession) {
logger.debug("IN");
OrganizationalUnitNodeWithGrant toReturn = null;
List<OrganizationalUnitGrantNode> grants = new ArrayList<OrganizationalUnitGrantNode>();
Query hibQuery = aSession.createQuery(" from SbiOrgUnitGrantNodes n where n.id.nodeId = ? " +
" and n.id.grantId = ?");
hibQuery.setInteger(0, node.getNodeId());
hibQuery.setInteger(1, grantId);
List hibList = hibQuery.list();
Iterator it = hibList.iterator();
while (it.hasNext()) {
grants.add(toOrganizationalUnitGrantNode((SbiOrgUnitGrantNodes) it.next(), aSession));
}
toReturn = new OrganizationalUnitNodeWithGrant(node, grants);
logger.debug("OUT");
return toReturn;
}