Java Reference
In-Depth Information
Besides running queries, this class will execute some other methods that are not
bound to the user session, such as the deleteAllData method that is to be used
to clean the DB data and restart the application.
Adding services to your application
Until now we have coded all the information that will be visible to the user through
the application screen. What is obviously missing here is all the business logic
that translates ultimately into inserting data or updating the existing data. For this
reason, we will now add two classes under
com.packtpub.as7development.chapter5.service package. The first one
is TicketService , which is a stateless EJB that will be used to perform the core
business logic of this application, and the second one is our stateful EJB's counter-
part, BookerService . Let's start with the stateless EJB.
@Stateless
public class TicketService {
@Inject
private Logger log;
@Inject
private EntityManager em;
@Inject
private Event<SeatType> seatTypeEventSrc;
@Inject
private Event<Seat> seatEventSrc;
@Inject
private DataManager repository;
@Inject
private List <SeatType> seatTypes;
public void createSeatType(SeatType seat)
Search WWH ::




Custom Search