May 6, 2009

DevX - Software Development Resource

Writing a Parameterized SQL Query in EJB 3.0

protected EntityManager manager;…String ejbqlDelete = “delete from ClientTicket p where ” + “p.closed = :paramClosed and ” + “p.department = :paramDepartment and ” + “p.ticketUserID = :paramTicketUserID and ” +

DevX - Software Development Resource

Avoid Object Instantiation Within Loops

Avoid defining new objects within loop structures. Doing so hampers performance significantly, due to object creation overhead. Instead, define objects outside the loop and then use them inside the loop.