@Test public void testAddContainer() throws Exception { containerDao.addContainer(accountId, testContainer); }
public void addContainer(int accountId, Container container) throws SQLException { try { PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setInt(1, accountId); insertStatement.setString(2, container.toJson().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { dataAccessor.reset(); throw e; } }
ContainerDao { public void addContainer(int accountId, Container container) throws SQLException { try { PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setInt(1, accountId); insertStatement.setString(2, container.toJson().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { dataAccessor.reset(); throw e; } } }
ContainerDao { public void addContainer(int accountId, Container container) throws SQLException { try { PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setInt(1, accountId); insertStatement.setString(2, container.toJson().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { dataAccessor.reset(); throw e; } } ContainerDao(MySqlDataAccessor dataAccessor); }
ContainerDao { public void addContainer(int accountId, Container container) throws SQLException { try { PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setInt(1, accountId); insertStatement.setString(2, container.toJson().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { dataAccessor.reset(); throw e; } } ContainerDao(MySqlDataAccessor dataAccessor); void addContainer(int accountId, Container container); void updateContainer(int accountId, Container container); List<Container> getContainers(int accountId); List<Container> getNewContainers(long updatedSince); }
ContainerDao { public void addContainer(int accountId, Container container) throws SQLException { try { PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setInt(1, accountId); insertStatement.setString(2, container.toJson().toString()); insertStatement.executeUpdate(); } catch (SQLException e) { dataAccessor.reset(); throw e; } } ContainerDao(MySqlDataAccessor dataAccessor); void addContainer(int accountId, Container container); void updateContainer(int accountId, Container container); List<Container> getContainers(int accountId); List<Container> getNewContainers(long updatedSince); static final String CONTAINER_TABLE; static final String ACCOUNT_ID; static final String CONTAINER_ID; static final String CONTAINER_INFO; static final String VERSION; static final String CREATION_TIME; static final String LAST_MODIFIED_TIME; }