Class HotelInitEJB
- java.lang.Object
-
- info.ejava.examples.ejb.ejbjpa.ejb.HotelInitEJB
-
- All Implemented Interfaces:
HotelInitRemote
public class HotelInitEJB extends Object implements HotelInitRemote
The following EJB provides an example of an EJB using BEAN-managed transactions.
-
-
Field Summary
Fields Modifier and Type Field Description private EntityManagerFactory
emf
We will still get a resource from the container -- except in this case we will get an EMF rather than an EntityManager.(package private) HotelMgmtLocal
hotelMgmt
private static org.slf4j.Logger
logger
private UserTransaction
tx
We get a UTx injected to control our overall JTA transaction.
-
Constructor Summary
Constructors Constructor Description HotelInitEJB()
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
emf
private EntityManagerFactory emf
We will still get a resource from the container -- except in this case we will get an EMF rather than an EntityManager. Note the different @PersistenceUnit annotation as well.
-
hotelMgmt
HotelMgmtLocal hotelMgmt
-
tx
private UserTransaction tx
We get a UTx injected to control our overall JTA transaction.
-
-
Method Detail
-
init
@PostConstruct public void init()
-
clearAll
public void clearAll()
- Specified by:
clearAll
in interfaceHotelInitRemote
-
populate
public void populate()
- Specified by:
populate
in interfaceHotelInitRemote
-
-