コード例 #1
0
 @Override
 public void closeRecruitment(String id) throws ServiceException {
   // TODO Auto-generated method stub
   RecruitmentModel model = recruitmentDAO.get(id);
   model.setState(RecruitmentModel.EState.OverTime.getValue());
   recruitmentDAO.saveOrUpdate(model);
 }
コード例 #2
0
  @Override
  public void saveRecruitment(RecruitmentModel model, String attachmentIds)
      throws ServiceException {
    if (StringUtils.isEmpty(model.getId())) model.setPostTime(new Date());
    model.setAttachments(null);
    recruitmentDAO.saveOrUpdate(model);

    if (StringUtils.isNotEmpty(attachmentIds)) {
      String[] ids = attachmentIds.split(";");
      for (int i = 0; i < ids.length; i++) {
        AttachmentModel attachment = attachmentDAO.get(ids[i]);
        attachment.setBelongObject(RecruitmentModel.class.getSimpleName());
        attachment.setBelongObjectId(model.getId());
        attachmentDAO.saveOrUpdate(attachment);
      }
    }
    RecruitmentModel newModel = recruitmentDAO.get(model.getId());
    recruitmentDAO.merge(newModel);
  }