public boolean deleteTerm(Long id) { QueryRunner runner = DBUtilsHelper.getRunner(); ; try { runner.update(DETELE_TERM_SQL, id); } catch (SQLException e) { logger.error(e + ""); } return true; }
public boolean updateTerm(Term term) { QueryRunner runner = DBUtilsHelper.getRunner(); ; try { runner.update(UPDATE_TERM_SQL, term.getName(), term.getId()); } catch (SQLException e) { logger.error(e + ""); } return true; }
public Term getTerm(long id) { QueryRunner runner = DBUtilsHelper.getRunner(); ; ResultSetHandler<Term> resultSetHandler = new BeanHandler<Term>(Term.class); try { return runner.query(GET_TERM_SQL, resultSetHandler, id); } catch (SQLException e) { logger.error(e + ""); } return null; }
public Term getTerm(String name) { QueryRunner runner = DBUtilsHelper.getRunner(); ; ResultSetHandler<Term> resultSetHandler = new BeanHandler<Term>(Term.class); try { return runner.query(SQL_GET_TERM_BY_NAME, resultSetHandler, name); } catch (SQLException e) { logger.error(e + ""); } return null; }
public List<Term> getTerms() { QueryRunner runner = DBUtilsHelper.getRunner(); ; ResultSetHandler<List<Term>> resultSetHandler = new BeanListHandler<Term>(Term.class); try { return runner.query(GET_ALL_TERM_SQL, resultSetHandler); } catch (SQLException e) { logger.error(e + ""); } return null; }