private StudySubjectBean createStudySubject(
     SubjectBean subject, StudyBean studyBean, Date enrollmentDate, String secondaryId) {
   StudySubjectBean studySubject = new StudySubjectBean();
   studySubject.setSecondaryLabel(secondaryId);
   studySubject.setOwner(getUserAccount());
   studySubject.setEnrollmentDate(enrollmentDate);
   studySubject.setLabel(subject.getLabel());
   subject.setLabel(null);
   studySubject.setSubjectId(subject.getId());
   studySubject.setStudyId(studyBean.getId());
   studySubject.setStatus(Status.AVAILABLE);
   return studySubject;
 }
Exemplo n.º 2
0
 public StudySubjectBean createStudySubjectBean(
     StudyBean sBean, SubjectBean subjectBean, UserAccountBean uBean) {
   StudySubjectBean ssBean = new StudySubjectBean();
   subjectBean.setGender('\0'); // setting null character
   ssBean.setStudyId(sBean.getId());
   ssBean.setSubjectId(subjectBean.getId());
   ssBean.setStatus(Status.AVAILABLE);
   ssBean.setOwner(uBean);
   ssBean.setEnrollmentDate(new Date());
   int nextLabel = getStudySubjectDao().findTheGreatestLabel() + 1;
   ssBean.setLabel(Integer.toString(nextLabel));
   StudySubjectDAO ssdao = new StudySubjectDAO(dataSource);
   ssBean = (StudySubjectBean) ssdao.create(ssBean, false);
   return ssBean;
 }