"SELECT s FROM Student s WHERE s.nrMatricol=:v1").setParameter(
"v1", nrMatricol);
st = query.getResultList();
StudentForm result = new StudentForm();
if (!st.isEmpty()) {
String numeGrupa = (String) em
.createNativeQuery(
"SELECT grupa.NUME_GRUPA FROM Grupa,Student WHERE grupa.ID_GRUPA=student.studenti_id_grupa AND student.NR_MATRICOL=?1")
.setParameter(1, nrMatricol).getSingleResult();
result.setAn(st.get(0).getAnStudiu());
result.setEmail(st.get(0).getEmail());
result.setGrupa(numeGrupa);
result.setNrMatricol(nrMatricol);
result.setNume(st.get(0).getNume());
result.setPrenume(st.get(0).getPrenume());
}
em.getTransaction().commit();
em.close();
return result;
}