Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1.     @Transactional(readOnly = true, rollbackFor = Exception.class)
  2.     public List<Ticket> getTicketBySS(String sSessionId_p,
  3.             String sTicketStatus_p) throws RossRepositoryException, RossServiceException {
  4.         try{
  5.         // applying filter to TicketStatusDmn ID
  6.         List<JoinTable> joinTables = new ArrayList<ExampleJoinTable.JoinTable>();
  7.         List<Object> equalStatus = new ArrayList<Object>();
  8.         equalStatus.add(new Equal("id", Integer.parseInt(sTicketStatus_p)));
  9.         joinTables.add(new JoinTable("ticketStatusDmn", equalStatus));
  10.        
  11.         // applying filter to Session ID
  12.         List<Object> equalSession = new ArrayList<Object>();
  13.         equalStatus.add(new Equal("id", Integer.parseInt(sTicketStatus_p)));
  14.         joinTables.add(new JoinTable("sessions", equalSession));
  15.        
  16.         ExampleJoinTable example = new ExampleJoinTable(joinTables);
  17.         List<Ticket> result = ticketDAO.findByExample(new Ticket(), example);
  18.         return result;
  19.         }
  20.         catch (RossRepositoryException e) {
  21.             log.error("TicketService.getTicketsBySession", e);
  22.             throw new RossRepositoryException(e);
  23.         } catch (Exception e) {
  24.             log.error("TicketService.getTicketsBySession", e);
  25.             throw new RossServiceException(e);
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement