// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by SessionBeanBase.vsl in andromda-ejb3-cartridge on 09/18/2014 16:56:07. // package org.andromda.test.howto18.a; import java.util.Collection; import javax.annotation.Resource; import javax.ejb.EJB; import javax.ejb.SessionContext; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; /** * Autogenerated EJB3 session bean base class UserServiceBean which contains * method level annotations for the session bean. All method level annotations * are inherited by the extending session bean class. *

* TODO: Model Documentation for UserService *

*/ public abstract class UserServiceBase implements UserService { // ------ Session Context Injection ------ /** * SessionContext Injection */ @Resource protected SessionContext context; // ------ Persistence Context Definitions -------- /** * Inject persistence context howtomodel */ @PersistenceContext(unitName = "howtomodel") protected EntityManager emanager; // ------ DAO Injection Definitions -------- /** * Inject DAO UserDao */ @EJB private UserDao userDao; // --------------- Constructors --------------- /** * Default constructor method with no arguments. */ public UserServiceBase() { super(); } // ------ DAO Getters -------- /** * Get the injected DAO UserDao * @return UserDao */ protected UserDao getUserDao() { return this.userDao; } // -------- Business Methods -------------- /** *

* TODO: Model Documentation for addUser *

* @param user * @throws UserException */ public void addUser(User user) throws UserException { if (user == null) { throw new IllegalArgumentException( "org.andromda.test.howto18.a.UserServiceBean.addUser(User user) - 'user' can not be null"); } try { this.handleAddUser(user); } catch (UserException ex) { throw ex; } catch (Throwable th) { throw new UserServiceException( "Error performing 'UserService.addUser(User user)' --> " + th, th); } } /** * Performs the core logic for {@link #addUser(User)} * @param user * @throws Exception */ protected abstract void handleAddUser(User user) throws Exception; /** *

* TODO: Model Documentation for getUser *

* @param id * @return User * @throws UserException */ public User getUser(Long id) throws UserException { if (id == null) { throw new IllegalArgumentException( "org.andromda.test.howto18.a.UserServiceBean.getUser(Long id) - 'id' can not be null"); } try { return this.handleGetUser(id); } catch (UserException ex) { throw ex; } catch (Throwable th) { throw new UserServiceException( "Error performing 'UserService.getUser(Long id)' --> " + th, th); } } /** * Performs the core logic for {@link #getUser(Long)} * @param id * @return User * @throws Exception */ protected abstract User handleGetUser(Long id) throws Exception; /** *

* TODO: Model Documentation for getAllUsers *

* @return Collection * @throws UserException */ public Collection getAllUsers() throws UserException { try { return this.handleGetAllUsers(); } catch (UserException ex) { throw ex; } catch (Throwable th) { throw new UserServiceException( "Error performing 'UserService.getAllUsers()' --> " + th, th); } } /** * Performs the core logic for {@link #getAllUsers()} * @return Collection * @throws Exception */ protected abstract Collection handleGetAllUsers() throws Exception; // -------- Lifecycle Callbacks -------------- }