public void save(){
        if(this.getId() != null){
            String sql = "DELETE FROM crew_log " +
                    "WHERE crew_log.crew = ?";
            try {
                PreparedStatement preparedStatement = Crew.getConnection().prepareStatement(sql);
                preparedStatement.setInt(1, this.getId());
                preparedStatement.executeUpdate();
            } catch (SQLException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            }
        }else{
            String sql = "INSERT INTO crew (" +
                    "name," +
                    "date" +
                    ")" +
                    "VALUES (" +
                    "?,?" +
                    ")";
            try {
                PreparedStatement preparedStatement = Crew.getConnection().prepareStatement(
                        sql,
                        Statement.RETURN_GENERATED_KEYS
                );
                preparedStatement.setString(1, this.getName());
                preparedStatement.setTimestamp(2,
                        new Timestamp(
                                this.getDate().getTime()
                        ));
                preparedStatement.executeUpdate();
                ResultSet resultSet = preparedStatement.getGeneratedKeys();
                if(resultSet.next()){
                    this.setId(resultSet.getInt(1));
                }
                resultSet.close();
            }catch (SQLException ex){
                ex.printStackTrace();
            }
        }
        try{
            String sql = "INSERT INTO crew_log (crew, worker) " +
                    "VALUES (?,?)";
            PreparedStatement preparedStatement = Crew.getConnection().prepareStatement(sql);
            for(int i = 0; i < workers.size(); i++){
                preparedStatement.setInt(1, this.getId());
                preparedStatement.setInt(2, workers.get(i).getId());
                preparedStatement.addBatch();
            }
            preparedStatement.executeBatch();
            preparedStatement.close();
        } catch (SQLException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }