@Override public int getCount(DaoFilter daoFilter) throws DaoException{ DSLContext context = getJooq(); try { Collection<Condition> conditions = new ArrayList<Condition>(); if (daoFilter.getLangIds() != null) { conditions.add(Tables.LOCAL_PAGE.LANG_ID.in(daoFilter.getLangIds())); } if (daoFilter.getNameSpaceIds() != null) { conditions.add(Tables.LOCAL_PAGE.NAME_SPACE.in(daoFilter.getNameSpaceIds())); } if (daoFilter.isRedirect() != null) { conditions.add(Tables.LOCAL_PAGE.IS_REDIRECT.in(daoFilter.isRedirect())); } if (daoFilter.isDisambig() != null) { conditions.add(Tables.LOCAL_PAGE.IS_DISAMBIG.in(daoFilter.isDisambig())); } return context.selectCount(). from(Tables.LOCAL_PAGE). where(conditions). fetchOne().value1(); } finally { freeJooq(context); } }
freeJooq(context); throw e;
freeJooq(context);
freeJooq(context); throw e;
@Override public LocalPage getById(Language language, int pageId) throws DaoException { DSLContext context = getJooq(); try { Record record = context.select(). from(Tables.LOCAL_PAGE). where(Tables.LOCAL_PAGE.PAGE_ID.eq(pageId)). and(Tables.LOCAL_PAGE.LANG_ID.eq(language.getId())). limit(1). fetchOne(); return buildLocalPage(record); } finally { freeJooq(context); } }
@Override public LocalPage getByTitle(Title title, NameSpace nameSpace) throws DaoException { DSLContext context = getJooq(); try { Record record = context.select(). from(Tables.LOCAL_PAGE). where(Tables.LOCAL_PAGE.TITLE.eq(title.getCanonicalTitle())). and(Tables.LOCAL_PAGE.LANG_ID.eq(title.getLanguage().getId())). and(Tables.LOCAL_PAGE.NAME_SPACE.eq(nameSpace.getArbitraryId())). limit(1). fetchOne(); return buildLocalPage(record); } finally { freeJooq(context); } }