@Override public void reopenTicket(Ticket ticket) { validateTicket(ticket); ticket.setStatus(TicketStatus.REOPEN); ticket.setLastModifiedDate(new Timestamp(System.currentTimeMillis())); updateTicket(ticket); }
@Override public void closeTicket(Ticket ticket) { validateTicket(ticket); ticket.setStatus(TicketStatus.CLOSED); ticket.setLastModifiedDate(new Timestamp(System.currentTimeMillis())); updateTicket(ticket); }
/** ************* Ticket Operations ***************** */ @Override public int createTicket(Ticket ticket) { validateTicket(ticket); if (ticket.getStatus() == null || ticket.getStatus() != TicketStatus.OPEN) ticket.setStatus(TicketStatus.OPEN); if (ticket.getCreator() == null) ticket.setCreator(userManager.getLoggedInUser()); ticket.setCreatedDate(new Timestamp(System.currentTimeMillis())); int id = (Integer) getHibernateTemplate().save(ticket); return id; }
@Override public void updateTicket(Ticket ticket) { validateTicket(ticket); ticket.setLastModifiedDate(new Timestamp(System.currentTimeMillis())); getHibernateTemplate().saveOrUpdate(ticket); }
public List<TicketNote> searchTicketNotes(Ticket ticket) { validateTicket(ticket); int ticketId = ticket.getId(); return getHibernateTemplate().find("from TicketNote where ticketId = ?", ticketId); }