comparison flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java @ 5173:14d19313268a

Catch IllegalArgumentException instead of RuntimeException, added logging.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 05 Mar 2013 09:51:55 +0100
parents c1b60f8c3390
children 9d36ddf7dbd3
comparison
equal deleted inserted replaced
5172:a51515056c45 5173:14d19313268a
100 this.geom = geom; 100 this.geom = geom;
101 } 101 }
102 102
103 103
104 public static List<RiverAxis> getRiverAxis(String river) 104 public static List<RiverAxis> getRiverAxis(String river)
105 throws RuntimeException { 105 throws IllegalArgumentException {
106 return getRiverAxis(river, KIND_CURRENT); 106 return getRiverAxis(river, KIND_CURRENT);
107 } 107 }
108 108
109 public static List<RiverAxis> getRiverAxis(String river, int kind) 109 public static List<RiverAxis> getRiverAxis(String river, int kind)
110 throws RuntimeException { 110 throws IllegalArgumentException {
111 Session session = SessionHolder.HOLDER.get(); 111 Session session = SessionHolder.HOLDER.get();
112 Query query = session.createQuery( 112 Query query = session.createQuery(
113 "from RiverAxis where river.name =:river AND kind.id =:kind"); 113 "from RiverAxis where river.name =:river AND kind.id =:kind");
114 query.setParameter("river", river); 114 query.setParameter("river", river);
115 query.setParameter("kind", kind); 115 query.setParameter("kind", kind);
117 try { 117 try {
118 List<RiverAxis> list = query.list(); 118 List<RiverAxis> list = query.list();
119 return list.isEmpty() ? null : list; 119 return list.isEmpty() ? null : list;
120 } 120 }
121 catch (RuntimeException re) { 121 catch (RuntimeException re) {
122 throw iae; 122 throw re.getCause();
123 } 123 }
124
125
126 } 124 }
127 } 125 }
128 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 126 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org