@Test public void testInsertOneTaskAssignment() { assertEquals(documentDTO.getDocumentID(),taskAssignment.getDocumentID()); }
@Override public int insertOneTaskAssignment(Long documentID, Long userID) { try { List<TaskAssignment> taskAssignments = getAllByCriteria(Restrictions.eq("id.documentId", documentID)); if(null == taskAssignments || taskAssignments.size()== 0){ TaskAssignment taskAssignment = new TaskAssignment(documentID, userID, new Date()); save(taskAssignment); em.flush(); return 1; } } catch (Exception e) { logger.error("Error in insert operation!", e); } return 0; }
TaskAssignmentResourceFacadeImp extends CoreDBServiceFacadeImp<TaskAssignment, Long> implements TaskAssignmentResourceFacade { @Override public int insertOneTaskAssignment(Long documentID, Long userID) { try { List<TaskAssignment> taskAssignments = getAllByCriteria(Restrictions.eq("id.documentId", documentID)); if(null == taskAssignments || taskAssignments.size()== 0){ TaskAssignment taskAssignment = new TaskAssignment(documentID, userID, new Date()); save(taskAssignment); em.flush(); return 1; } } catch (Exception e) { logger.error("Error in insert operation!", e); } return 0; } }
TaskAssignmentResourceFacadeImp extends CoreDBServiceFacadeImp<TaskAssignment, Long> implements TaskAssignmentResourceFacade { @Override public int insertOneTaskAssignment(Long documentID, Long userID) { try { List<TaskAssignment> taskAssignments = getAllByCriteria(Restrictions.eq("id.documentId", documentID)); if(null == taskAssignments || taskAssignments.size()== 0){ TaskAssignment taskAssignment = new TaskAssignment(documentID, userID, new Date()); save(taskAssignment); em.flush(); return 1; } } catch (Exception e) { logger.error("Error in insert operation!", e); } return 0; } TaskAssignmentResourceFacadeImp(); }
TaskAssignmentResourceFacadeImp extends CoreDBServiceFacadeImp<TaskAssignment, Long> implements TaskAssignmentResourceFacade { @Override public int insertOneTaskAssignment(Long documentID, Long userID) { try { List<TaskAssignment> taskAssignments = getAllByCriteria(Restrictions.eq("id.documentId", documentID)); if(null == taskAssignments || taskAssignments.size()== 0){ TaskAssignment taskAssignment = new TaskAssignment(documentID, userID, new Date()); save(taskAssignment); em.flush(); return 1; } } catch (Exception e) { logger.error("Error in insert operation!", e); } return 0; } TaskAssignmentResourceFacadeImp(); @Override int insertTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int insertOneTaskAssignment(Long documentID, Long userID); @Override int undoTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int undoTaskAssignment(Map<Long, Long> taskMap); @Override int undoTaskAssignment(Long documentID, Long userID); @Override void undoTaskAssignmentByTimer(); @Override TaskAssignmentDTO findTaskAssignment(Long documentID, Long userID); @Override List<TaskAssignmentDTO> findTaskAssignmentByID(Long documentID); @Override Integer getPendingTaskCount(Long userID); }
TaskAssignmentResourceFacadeImp extends CoreDBServiceFacadeImp<TaskAssignment, Long> implements TaskAssignmentResourceFacade { @Override public int insertOneTaskAssignment(Long documentID, Long userID) { try { List<TaskAssignment> taskAssignments = getAllByCriteria(Restrictions.eq("id.documentId", documentID)); if(null == taskAssignments || taskAssignments.size()== 0){ TaskAssignment taskAssignment = new TaskAssignment(documentID, userID, new Date()); save(taskAssignment); em.flush(); return 1; } } catch (Exception e) { logger.error("Error in insert operation!", e); } return 0; } TaskAssignmentResourceFacadeImp(); @Override int insertTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int insertOneTaskAssignment(Long documentID, Long userID); @Override int undoTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int undoTaskAssignment(Map<Long, Long> taskMap); @Override int undoTaskAssignment(Long documentID, Long userID); @Override void undoTaskAssignmentByTimer(); @Override TaskAssignmentDTO findTaskAssignment(Long documentID, Long userID); @Override List<TaskAssignmentDTO> findTaskAssignmentByID(Long documentID); @Override Integer getPendingTaskCount(Long userID);  }