Пример #1
0
 public boolean hasVacancy(Course course, Role role) {
   List<PersonRoleCourse> results = prcRepository.findCurso(course, role);
   int registereds = results.size();
   if (results.isEmpty() || registereds < course.getStudents()) {
     return true;
   } else {
     return false;
   }
 }
Пример #2
0
 public boolean isRegistered(User user, Course course) {
   List<PersonRoleCourse> results = prcRepository.findRegistered(user, course);
   // System.out.println(resultados.get(0).getCurso().getNome()+" ::
   // "+resultados.get(0).getPessoa().getNome());
   if (results.isEmpty()) {
     return false;
   } else {
     return true;
   }
 }
Пример #3
0
 public PersonRoleCourse insertPersonRoleCourse(PersonRoleCourse prc) {
   return prcRepository.makePersistent(prc);
 }
Пример #4
0
 public void deletePersonRoleCourse(PersonRoleCourse prc) {
   prcRepository.makeTransient(prc);
 }
Пример #5
0
 public PersonRoleCourse searchPersonRoleCourse(Person person, Course course) {
   return prcRepository.searchPersonRoleCourse(person, course);
 }
Пример #6
0
 public PersonRoleCourse updatePersonRoleCourse(PersonRoleCourse prc) {
   System.out.println("SQL QUERY PRA UPDATE PRC: ");
   return prcRepository.makePersistentU(prc);
 }
Пример #7
0
 public List<User> listUsersByCourse(Course course, Role role) {
   return prcRepository.listUsersByCourse(course, role);
 }
Пример #8
0
 public int countUsersByCourse(Course course, Role role) {
   List<PersonRoleCourse> results = prcRepository.findCurso(course, role);
   return results.size();
 }