changeset 141:b02310d7ffee

Make Classes Serializable for Storing in ArtifactDatabase geo-backend/trunk@131 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 24 Sep 2009 15:24:11 +0000 (2009-09-24)
parents 2f1b87e1a40c
children 25be806da62f
files geo-backend/Changelog geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java
diffstat 5 files changed, 29 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/geo-backend/Changelog	Mon Sep 21 15:30:07 2009 +0000
+++ b/geo-backend/Changelog	Thu Sep 24 15:24:11 2009 +0000
@@ -1,3 +1,11 @@
+2009-09-24  Tim Englich  <tim.englich@intevation.de>
+
+    * src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java Edited, 
+      src/main/java/de/intevation/gnv/geobackend/base/Result.java Edited, 
+      src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java Edited,  
+      src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Edited:
+      Make Classes Serializable for Storing in ArtifactDatabase 
+      
 2009-09-21  Tim Englich  <tim.englich@intevation.de>
 
     * src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java: 
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Mon Sep 21 15:30:07 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Thu Sep 24 15:24:11 2009 +0000
@@ -18,6 +18,12 @@
 public class DefaultResult implements Result {
 
     /**
+     * THE UID of this Classe
+     */
+    private static final long serialVersionUID = -6886218808840982766L;
+
+
+    /**
      * HashMap which stores the Columnvalues identified by the unique Columnname
      */
     private HashMap<String, Object> columnValues = new HashMap<String, Object>();
@@ -41,16 +47,13 @@
      */
     public Date getDate(String columnName) {
         Object o = this.columnValues.get(columnName);
+        Date d = null;
         if(o instanceof Date){
-            return (Date)o;
+            d = (Date)o;
         }else if (o instanceof GregorianCalendar){
-            return ((GregorianCalendar)o).getTime();
-        }else{
-            // TODO FIXME FEHLER finden.
-            return null;
+            d = ((GregorianCalendar)o).getTime();
         }
-        
-        
+        return d;
     }
 
     /**
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java	Mon Sep 21 15:30:07 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java	Thu Sep 24 15:24:11 2009 +0000
@@ -15,6 +15,11 @@
 public class DefaultResultDescriptor implements ResultDescriptor {
 
     /**
+     *The Uid of this Class
+     */
+    private static final long serialVersionUID = 7016889733270716130L;
+
+    /**
      * The Names of the Columns of one Result
      */
     private List<String> columnNames = new ArrayList<String>();
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java	Mon Sep 21 15:30:07 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java	Thu Sep 24 15:24:11 2009 +0000
@@ -3,6 +3,7 @@
  */
 package de.intevation.gnv.geobackend.base;
 
+import java.io.Serializable;
 import java.util.Date;
 
 
@@ -12,7 +13,7 @@
  * @author Tim Englich <tim.englich@intevation.de>
  *
  */
-public interface Result {
+public interface Result extends Serializable{
   
     /**
      * Returns the ResultDescriptor which provides the
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java	Mon Sep 21 15:30:07 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java	Thu Sep 24 15:24:11 2009 +0000
@@ -2,12 +2,15 @@
  *
  */
 package de.intevation.gnv.geobackend.base;
+
+import java.io.Serializable;
+
 /**
  * Interface which provides the Methods for Accessing
  * the MetaData of an ResultEntry
  * @author Tim Englich <tim.englich@intevation.de>
  */
-public interface ResultDescriptor {
+public interface ResultDescriptor extends Serializable{
 
     /**
      * Returns the Classname of the Column

http://dive4elements.wald.intevation.org