Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Transactional
- public class CustomerService {
- @Inject
- private EntityManager em;
- @Inject
- private Logger logger;
- public void createCustomer(Customer customer) {
- em.persist(customer);
- }
- public Customer findCustomerById(Long id) {
- return em.find(Customer.class, id);
- }
- @AroundInvoke
- private Object logMethod( InvocationContext ic ) throws Exception {
- logger.entering( ic .getTarget().toString(), ic .getMethod().getName());
- try {
- return ic.proceed() ;
- } finally {
- logger.exiting( ic .getTarget().toString(), ic .getMethod().getName());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement