table = "CategoryGroupLink";
table = "CategoryGroupCategoryLink";
    IObject findLink(IObject parent, IObject child)        throws DSOutOfServiceException, DSAccessException    {        try {            String table = null;            Class klass = parent.getClass();            if (klass.equals(Category.class)) table = "CategoryImageLink";            else if (klass.equals(Dataset.class)) table = "DatasetImageLink";            else if (klass.equals(Project.class)) table = "ProjectDatasetLink";            else if (klass.equals(CategoryGroup.class))                 table = "CategoryGroupLink";            if (table == null) return null;            String sql = "select link from "+table+" as link where " +                    "link.parent.id = :parentID and link.child.id = :childID";            IQuery service = getIQueryService();            Parameters param = new Parameters();            param.addLong("parentID", parent.getId());            param.addLong("childID", child.getId());           return service.findByQuery(sql, param);        } catch (Exception e) {            handleException(e, "Cannot retrieve the requested link for "+            "parent ID: "+parent.getId()+" and child ID: "+child.getId());        }        return null;    }