i'm using hibernate and i've the following classes: domain object:
in order to have persistence code apart, i made:
i know i do have to implement proper catching; now, 2 Qs: 1) is this Dao? 2) is it good to use try catch instead of adding a throws hibernateException?
thanks in advance
Joined: Mar 19, 2002
1. It looks like DAO to me.
2. I would wrap a custom exception around the HibernateException. This would further enforce the client/service to code to the interface, thus further hiding the fact that you you are using Hibernate as ORM. So if you change to a different ORM, the client code will not change.