+ "(select i.ITEM_ID from FEEDSUBSCRIBERS feedsubscr2_, CHANNELS channel3_, ITEMS items4_ "
+ "(select items4_.ITEM_ID from FEEDSUBSCRIBERS feedsubscr2_, CHANNELS channel3_, ITEMS items4_ "
    public Collection getItemsForUserByChannel(String username, int limit,            int channel_id) throws IndexOutOfBoundsException {        if (limit > this.upperLimit) {            log                    .warn("Someone want more see more Items than specified in this.upperLimit!");            log.warn("Cut down " + limit + " to " + this.upperLimit);            limit = this.upperLimit;        }        String query = "select {i.*}, {uri.*} from Items as i LEFT OUTER JOIN usersReadItems as uri "                + "on (i.item_id=uri.item_id and uri.username='"                + username                + "') "                + "where i.item_id in "                + "(select i.ITEM_ID from FEEDSUBSCRIBERS feedsubscr2_, CHANNELS channel3_, ITEMS items4_ "                + "where feedsubscr2_.CHANNEL_ID=channel3_.CHANNEL_ID and channel3_.CHANNEL_ID=items4_.CHANNEL_ID and "                + "(feedsubscr2_.username like '"                + username                + "') and "                + "(feedsubscr2_.channel_id = " //here is the diff!                + channel_id + ")) order by i.date DESC LIMIT " + limit;        try {            java.util.Collection c = this.getSession().createSQLQuery(query,                    new String[] { "i", "uri" },                    new Class[] { Item.class, UserReadItem.class }).list();            log.debug("Resultset: " + c.size());            return this.simplifyCollection(c);        } catch (DataAccessResourceFailureException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (HibernateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IllegalStateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return null;    }