diff flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java @ 5181:9d36ddf7dbd3

Change IllegalArgumentException to HibernateException.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 07 Mar 2013 10:44:27 +0100
parents 14d19313268a
children ae60bb7b8085
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Thu Mar 07 10:44:27 2013 +0100
@@ -107,20 +107,15 @@
     }
 
     public static List<RiverAxis> getRiverAxis(String river, int kind)
-    throws IllegalArgumentException {
+    throws HibernateException {
         Session session = SessionHolder.HOLDER.get();
         Query query = session.createQuery(
             "from RiverAxis where river.name =:river AND kind.id =:kind");
         query.setParameter("river", river);
         query.setParameter("kind", kind);
 
-        try {
-            List<RiverAxis> list = query.list();
-            return list.isEmpty() ? null : list;
-        }
-        catch (RuntimeException re) {
-            throw re.getCause();
-        }
+        List<RiverAxis> list = query.list();
+        return list.isEmpty() ? null : list;
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org