diff flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumn.java @ 497:67fd63e4ef66

Importer: centralized caching flys-backend/trunk@1851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 08 May 2011 15:29:45 +0000
parents db430bd9e0e0
children cce054f27dac
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumn.java	Sun May 08 11:20:39 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportWstColumn.java	Sun May 08 15:29:45 2011 +0000
@@ -2,7 +2,6 @@
 
 import de.intevation.flys.model.Wst;
 import de.intevation.flys.model.WstColumn;
-import de.intevation.flys.model.WstColumnValue;
 import de.intevation.flys.model.River;
 
 import org.hibernate.Session;
@@ -10,7 +9,6 @@
 
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Map;
 
 import java.math.BigDecimal;
 
@@ -24,8 +22,6 @@
     protected List<ImportWstColumnQRange> columnQRanges;
     protected List<ImportWstColumnValue>  columnValues;
 
-    protected Map<WstColumnValueKey, WstColumnValue> wstCache;
-
     protected WstColumn peer;
 
     public ImportWstColumn() {
@@ -37,15 +33,13 @@
         ImportWst wst,
         String    name,
         String    description,
-        Integer   position,
-        Map<WstColumnValueKey, WstColumnValue> wstCache
+        Integer   position
     ) {
         this();
         this.wst         = wst;
         this.name        = name;
         this.description = description;
         this.position    = position;
-        this.wstCache    = wstCache;
     }
 
     public ImportWst getWst() {
@@ -82,7 +76,7 @@
 
     public void addColumnValue(BigDecimal position, BigDecimal w) {
         columnValues.add(
-            new ImportWstColumnValue(this, position, w, wstCache));
+            new ImportWstColumnValue(this, position, w));
     }
 
     public void addColumnQRange(ImportWstQRange columnQRange) {
@@ -103,7 +97,7 @@
     public WstColumn getPeer(River river) {
         if (peer == null) {
             Wst w = wst.getPeer(river);
-            Session session = Importer.sessionHolder.get();
+            Session session = ImporterSession.getInstance().getDatabaseSession();
             Query query = session.createQuery(
                 "from WstColumn where " +
                 "wst=:wst and name=:name and description=:description" +

http://dive4elements.wald.intevation.org