You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by hi...@jakarta.apache.org on 2004/09/16 08:34:34 UTC

[Jakarta HiveMind Wiki] Updated: HibernateSupport

   Date: 2004-09-15T23:34:34
   Editor: JeanFrancoisPoilpret <jf...@yahoo.fr>
   Wiki: Jakarta HiveMind Wiki
   Page: HibernateSupport
   URL: http://wiki.apache.org/jakarta-hivemind/HibernateSupport

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -69,3 +69,14 @@
 
 = Discussion =
 
+I would like to add some additional request here.
+
+A recurrent problem (at least for me but I suppose I am not the only one) when using Hibernate API is that almost EVERY method can throw HibernateException which is checked. Personnally I prefer to use checked exceptions only for business, and unchecked (runtime) exception for "technical" problems. Hence using Hibernate obliges me (and others) to put an infamous try{}catch(){throw new RT;} in all my DAO methods!
+
+As far as I know in Spring framework, some "template" class (as it is called in Spring) has been created to change HibernateException in most calls into a Runtime exception.
+
+I think it would be good to offer the same kind of service in Hivemind.
+
+Unfortunately, I could not find any "powerful" way to implement that (in a generic way by proxies, for instance). The fact is that MANY Hibernate interfaces (SessionFactory, Session, Query, Criteria...) have methods throwing HibernateException.
+
+This makes me better understand the way it has been implemented in Spring: one Template class that combines all Session API + other common API from other classes, but it seems to me that it reduces the possibilities of Hibernate for the developer.

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org