@Override
    public RoleSchool addRoleFromGSON(String json, long id) {
        EntityManager em = emf.createEntityManager();
        RoleSchool role = gson.fromJson(json, RoleSchool.class);
        if (role.getRoleName().equals("Student")) {
            role = gson.fromJson(json, Student.class);
        }
        if (role.getRoleName().equals("Teacher")) {
            role = gson.fromJson(json, Teacher.class);
        }
        if (role.getRoleName().equals("AssistantTeacher")) {
            role = gson.fromJson(json, AssistantTeacher.class);
        }
        Person person = null;

        em.getTransaction().begin();
        try {
            person = em.find(Person.class, id);
            role.setPerson(person);
            person.addRole(role);
            em.persist(role);
            em.getTransaction().commit();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            em.getTransaction().rollback();
        } finally {
            em.close();
        }
        return role;
    }