comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java @ 327:e09634fbf6bc

Moved the query complexity of creating a w/q value table into view 'wst_value_table' and used this instead. flys-artifacts/trunk@1724 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 18 Apr 2011 16:01:23 +0000
parents 07eba6d3b4a5
children 64cfbd631f29
comparison
equal deleted inserted replaced
326:07eba6d3b4a5 327:e09634fbf6bc
24 implements Serializable 24 implements Serializable
25 { 25 {
26 26
27 // TODO: put this into a property file 27 // TODO: put this into a property file
28 public static final String SQL_POS_WQ = 28 public static final String SQL_POS_WQ =
29 "SELECT wcv.position AS position," + 29 "SELECT position, w, q, column_pos" +
30 " w," + 30 " FROM wst_value_table" +
31 " (SELECT q" + 31 " WHERE wst_id = :wst_id";
32 " FROM wst_column_q_ranges wcqr" +
33 " JOIN wst_q_ranges wqr" +
34 " ON wcqr.wst_q_range_id = wqr.id" +
35 " JOIN ranges r" +
36 " ON r.id = wqr.range_id" +
37 " WHERE wcqr.wst_column_id = wc.id" +
38 " AND wcv.position BETWEEN r.a AND r.b) AS q," +
39 " wc.position AS column_pos " +
40 "FROM wst_column_values wcv" +
41 " JOIN wst_columns wc" +
42 " ON wcv.wst_column_id = wc.id" +
43 " JOIN wsts w" +
44 " ON wc.wst_id = w.id " +
45 "WHERE w.id = :wst_id" +
46 "ORDER BY wcv.position ASC," +
47 " wc.position DESC";
48 32
49 public static class Column 33 public static class Column
50 implements Serializable 34 implements Serializable
51 { 35 {
52 protected String name; 36 protected String name;

http://dive4elements.wald.intevation.org