AthleteManagerBase.java

  1. // license-header java merge-point
  2. //
  3. // Attention: Generated code! Do not modify by hand!
  4. // Generated by SessionBeanBase.vsl in andromda-ejb3-cartridge on 08/08/2014 12:21:04.
  5. //
  6. package org.andromda.demo.ejb3.athlete;

  7. import java.util.Collection;
  8. import javax.annotation.Resource;
  9. import javax.ejb.EJB;
  10. import javax.ejb.SessionContext;
  11. import javax.persistence.EntityManager;
  12. import javax.persistence.PersistenceContext;

  13. /**
  14.  * Autogenerated EJB3 session bean base class AthleteManagerBean which contains
  15.  * method level annotations for the session bean.  All method level annotations
  16.  * are inherited by the extending session bean class.
  17.  * <p>
  18.  * TODO: Model Documentation for AthleteManager
  19.  * </p>
  20.  */
  21. public abstract class AthleteManagerBase
  22.     implements AthleteManager
  23. {
  24.     // ------ Session Context Injection ------

  25.     /**
  26.      * SessionContext Injection
  27.      */
  28.     @Resource
  29.     protected SessionContext context;

  30.     // ------ Persistence Context Definitions --------
  31.     /**
  32.      * Inject persistence context demo-ejb3
  33.      */
  34.     @PersistenceContext(unitName = "demo-ejb3")
  35.     protected EntityManager emanager;

  36.     // ------ DAO Injection Definitions --------

  37.     /**
  38.      * Inject DAO AthleteDao
  39.      */
  40.     @EJB
  41.     private AthleteDao athleteDao;

  42.     /**
  43.      * Inject DAO TrackAthleteDao
  44.      */
  45.     @EJB
  46.     private TrackAthleteDao trackAthleteDao;

  47.     // --------------- Constructors ---------------

  48.     /**
  49.      * Default constructor method with no arguments.
  50.      */
  51.     public AthleteManagerBase()
  52.     {
  53.         super();
  54.     }

  55.     // ------ DAO Getters --------

  56.     /**
  57.      * Get the injected DAO AthleteDao
  58.      * @return AthleteDao
  59.      */
  60.     protected AthleteDao getAthleteDao()
  61.     {
  62.         return this.athleteDao;
  63.     }

  64.     /**
  65.      * Get the injected DAO TrackAthleteDao
  66.      * @return TrackAthleteDao
  67.      */
  68.     protected TrackAthleteDao getTrackAthleteDao()
  69.     {
  70.         return this.trackAthleteDao;
  71.     }

  72.     // -------- Business Methods  --------------

  73.     /**
  74.      * <p>
  75.      * TODO: Model Documentation for addTrackAthlete
  76.      * </p>
  77.      * @param trackAthlete
  78.      */
  79.     public void addTrackAthlete(TrackAthlete trackAthlete)
  80.     {
  81.         if (trackAthlete == null)
  82.         {
  83.             throw new IllegalArgumentException(
  84.                 "org.andromda.demo.ejb3.athlete.AthleteManagerBean.addTrackAthlete(TrackAthlete trackAthlete) - 'trackAthlete' can not be null");
  85.         }
  86.         try
  87.         {
  88.             this.handleAddTrackAthlete(trackAthlete);
  89.         }
  90.         catch (Throwable th)
  91.         {
  92.             throw new AthleteManagerException(
  93.                 "Error performing 'AthleteManager.addTrackAthlete(TrackAthlete trackAthlete)' --> " + th,
  94.                 th);
  95.         }
  96.     }

  97.     /**
  98.      * Performs the core logic for {@link #addTrackAthlete(TrackAthlete)}
  99.      * @param trackAthlete
  100.      * @throws Exception
  101.      */
  102.     protected abstract void handleAddTrackAthlete(TrackAthlete trackAthlete)
  103.         throws Exception;

  104.     /**
  105.      * <p>
  106.      * TODO: Model Documentation for getAllAthletes
  107.      * </p>
  108.      * @return Collection
  109.      */
  110.     public Collection getAllAthletes()
  111.     {
  112.         try
  113.         {
  114.             return this.handleGetAllAthletes();
  115.         }
  116.         catch (Throwable th)
  117.         {
  118.             throw new AthleteManagerException(
  119.                 "Error performing 'AthleteManager.getAllAthletes()' --> " + th,
  120.                 th);
  121.         }
  122.     }

  123.     /**
  124.      * Performs the core logic for {@link #getAllAthletes()}
  125.      * @return Collection
  126.      * @throws Exception
  127.      */
  128.     protected abstract Collection handleGetAllAthletes()
  129.         throws Exception;


  130.     // -------- Lifecycle Callbacks --------------

  131. }