/** {@inheritDoc } */ @Override public Tools load(int nKey, Plugin plugin) { DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECT, plugin); daoUtil.setInt(1, nKey); daoUtil.executeQuery(); Tools tools = null; if (daoUtil.next()) { tools = new Tools(); tools.setId(daoUtil.getInt(1)); tools.setArtifactId(daoUtil.getString(2)); tools.setLastRelease(daoUtil.getString(3)); } daoUtil.free(); return tools; }
/** {@inheritDoc } */ @Override public Tools selectByArtifactId(String strArtifactId, Plugin plugin) { DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECT_BY_ARTIFACTID, plugin); daoUtil.setString(1, strArtifactId); daoUtil.executeQuery(); Tools tools = null; if (daoUtil.next()) { tools = new Tools(); tools.setId(daoUtil.getInt(1)); tools.setArtifactId(daoUtil.getString(2)); tools.setLastRelease(daoUtil.getString(3)); } daoUtil.free(); return tools; }
/** {@inheritDoc } */ @Override public Collection<Tools> selectToolsList(Plugin plugin) { Collection<Tools> toolsList = new ArrayList<Tools>(); DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECTALL, plugin); daoUtil.executeQuery(); while (daoUtil.next()) { Tools tools = new Tools(); tools.setId(daoUtil.getInt(1)); tools.setArtifactId(daoUtil.getString(2)); tools.setLastRelease(daoUtil.getString(3)); toolsList.add(tools); } daoUtil.free(); return toolsList; }