Mercurial > dive4elements > river
changeset 1897:cf8a376eb4c9
Fix and use SQL statement to fetch wst-names.
flys-artifacts/trunk@3257 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 16 Nov 2011 09:10:07 +0000 |
parents | 2e2ca95459d2 |
children | 7053e3255ab4 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Tue Nov 15 14:48:53 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Nov 16 09:10:07 2011 +0000 @@ -1,3 +1,8 @@ +2011-11-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java: + (getWstName): Fix and use SQL statement. + 2011-11-15 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/WQFacet.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java Tue Nov 15 14:48:53 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java Wed Nov 16 09:10:07 2011 +0000 @@ -41,7 +41,7 @@ /** Query to get name (description) for wst_id. */ public static final String SQL_SELECT_WST_NAME = "SELECT description from wsts "+ - "WHERE wst_id = :wst_id"; + "WHERE id = :wst_id"; private WKmsFactory() { @@ -86,8 +86,8 @@ String name = null; Session session = SessionHolder.HOLDER.get(); - SQLQuery nameQuery = session.createSQLQuery(SQL_SELECT_NAME) - .addScalar("name", StandardBasicTypes.STRING); + SQLQuery nameQuery = session.createSQLQuery(SQL_SELECT_WST_NAME) + .addScalar("description", StandardBasicTypes.STRING); nameQuery.setInteger("wst_id", wst_id); List<String> names = nameQuery.list();