package core.operation;

import core.user.User;
import dao.DBManagement;
import error.GExcptSQL;

import java.util.HashMap;
import java.util.Map;

public class Select extends Operation {

    @Override
    public Map<String, Object> execute(User subject) throws GExcptSQL {
        Map<String, String> vMap = new HashMap<>();
        Map<String, String> limits = new HashMap<>();
        String id = (String)this.getOptions().get("student_id");
        String teacher_id = (String)this.getOptions().get("teacher_id");
        limits.put("id",id);
        vMap.put("student_id",id);
        vMap.put("teacher_id",teacher_id);
        DBManagement.update("graduation_design", vMap,limits);
        vMap.remove("student_id");
        vMap.remove("teacher_id");
        return this.getOptions();
    }
}
