// 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.howto11.a; import java.util.List; 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 RentalServiceBean 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 RentalService *

*/ public abstract class RentalServiceBase implements RentalService { // ------ 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 PersonDao */ @EJB private PersonDao personDao; /** * Inject DAO CarDao */ @EJB private CarDao carDao; // ---------- Env Entry Injection ----------- /** * The companyCode resource injection */ @Resource(name = "companyCode") protected String companyCode; /** * The maxRentals resource injection */ @Resource(name = "maxRentals") protected int maxRentals; // --------------- Constructors --------------- /** * Default constructor method with no arguments. */ public RentalServiceBase() { super(); } // ------ DAO Getters -------- /** * Get the injected DAO PersonDao * @return PersonDao */ protected PersonDao getPersonDao() { return this.personDao; } /** * Get the injected DAO CarDao * @return CarDao */ protected CarDao getCarDao() { return this.carDao; } // -------- Business Methods -------------- /** *

* Returns a list of all cars known by the system. *

* @return List * @throws RentalException */ public List getAllCars() throws RentalException { try { return this.handleGetAllCars(); } catch (RentalException ex) { throw ex; } catch (Throwable th) { throw new RentalServiceException( "Error performing 'RentalService.getAllCars()' --> " + th, th); } } /** * Performs the core logic for {@link #getAllCars()} * @return List * @throws Exception */ protected abstract List handleGetAllCars() throws Exception; /** *

* Returns all customers with the specified name. *

* @param name * @return List * @throws RentalException */ public List getCustomersByName(String name) throws RentalException { if (name == null) { throw new IllegalArgumentException( "org.andromda.test.howto11.a.RentalServiceBean.getCustomersByName(String name) - 'name' can not be null"); } try { return this.handleGetCustomersByName(name); } catch (RentalException ex) { throw ex; } catch (Throwable th) { throw new RentalServiceException( "Error performing 'RentalService.getCustomersByName(String name)' --> " + th, th); } } /** * Performs the core logic for {@link #getCustomersByName(String)} * @param name * @return List * @throws Exception */ protected abstract List handleGetCustomersByName(String name) throws Exception; // -------- Lifecycle Callbacks -------------- }