An application is not complete without proper exception handling in place, this does not need to be complex so it can be very straightforward to model too.

Simply model a class and assign it the <<ApplicationException>> stereotype or the <<UnexpectedException>> stereotype (you will need to enable the Java cartridge for this to work).

Please note that by default an exception will be generated for each service.

The next thing to do is draw a dependency from a <<Entity>> or <<Service>> to this exception, this will make all operations throw this exception. You may choose to have a single operation throw a specific exception by drawing the dependency from that operation to the exception.

  • Auto-generated source that does not need manual editing
  • Auto-generated source that should be edited manually
  • File that is affected by the modifications applied in this section
  • Car.hbm.xml
  • Car.java
  • CarImpl.java
  • CarDao.java
  • CarDaoBase.java
  • CarDaoImpl.java
  • CarType.java
  • Person.hbm.xml
  • Person.java
  • PersonImpl.java
  • PersonDao.java
  • PersonDaoBase.java
  • PersonDaoImpl.java
  • RentalService.java
  • RentalServiceBase.java
  • RentalServiceImpl.java
  • RentalServiceException.java
  • ejb/RentalService.java
  • ejb/RentalServiceBean.java
  • ejb/RentalServiceHome.java


The next section covers the declarative security handling with Acegi, click here to go to that section.