From 665cf65d97327507e48cd34487f1044653d115e7 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Tue, 19 Mar 2019 15:04:00 +0100
Subject: [PATCH] As far as we got for now. MAJOR issues with JSONB replacing
 Jackson still unresolved!

---
 nb-configuration.xml                          |  1 -
 pom.xml                                       | 14 ++--
 .../java/no/nibio/vips/entity/Weather.java    | 82 -------------------
 .../nibio/vips/entity/WeatherObservation.java | 12 ++-
 4 files changed, 15 insertions(+), 94 deletions(-)
 delete mode 100755 src/main/java/no/nibio/vips/entity/Weather.java

diff --git a/nb-configuration.xml b/nb-configuration.xml
index d92c62a..7103095 100755
--- a/nb-configuration.xml
+++ b/nb-configuration.xml
@@ -14,6 +14,5 @@ That way multiple projects can share the same settings (useful for formatting ru
 Any value defined here will override the pom.xml file value but is only applicable to the current project.
 -->
         <netbeans.hint.license>nibio_open_source_license.ftl</netbeans.hint.license>
-        <netbeans.hint.jdkPlatform>JDK_1.8_SUN</netbeans.hint.jdkPlatform>
     </properties>
 </project-shared-configuration>
diff --git a/pom.xml b/pom.xml
index 4c7af6c..ec0a023 100755
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-annotations</artifactId>
-      <version>2.8.10</version>
+      <version>2.9.8</version>
     </dependency>
     <dependency>
       <groupId>commons-validator</groupId>
@@ -37,12 +37,12 @@
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-core</artifactId>
-      <version>2.8.10</version>
+      <version>2.9.8</version>
     </dependency>
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
-      <version>2.8.10</version>
+      <version>2.9.8</version>
     </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
@@ -67,13 +67,13 @@
     <dependency>
       <groupId>javax</groupId>
       <artifactId>javaee-api</artifactId>
-      <version>7.0</version>
+      <version>8.0</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>javax</groupId>
       <artifactId>javaee-web-api</artifactId>
-      <version>7.0</version>
+      <version>8.0</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
@@ -156,8 +156,8 @@
         <artifactId>maven-compiler-plugin</artifactId>
         <version>2.3.2</version>
         <configuration>
-          <source>1.8</source>
-          <target>1.8</target>
+          <source>10</source>
+          <target>10</target>
         </configuration>
       </plugin>
       <plugin>
diff --git a/src/main/java/no/nibio/vips/entity/Weather.java b/src/main/java/no/nibio/vips/entity/Weather.java
deleted file mode 100755
index 6ab58b5..0000000
--- a/src/main/java/no/nibio/vips/entity/Weather.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2014 NIBIO <http://www.nibio.no/>. 
- * 
- * This file is part of VIPSCommon.
- * VIPSCommon is free software: you can redistribute it and/or modify
- * it under the terms of the NIBIO Open Source License as published by 
- * NIBIO, either version 1 of the License, or (at your option) any
- * later version.
- * 
- * VIPSCommon is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * NIBIO Open Source License for more details.
- * 
- * You should have received a copy of the NIBIO Open Source License
- * along with VIPSCommon.  If not, see <http://www.nibio.no/licenses/>.
- * 
- */
-
-package no.nibio.vips.entity;
-
-import java.util.Date;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * TEST object
- * @author treinar
- */
-@XmlRootElement(name="weather")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class Weather {
-    
-    public Weather()
-    {
-        
-    }
-    
-    public Weather(Date date, String details){
-        this.date=date;
-        this.details=details;
-    }
-    
-    @XmlAttribute
-    private Date date;
-    
-    @XmlElement
-    private String details;
-    
-    
-
-    /**
-     * @return the date
-     */
-    public Date getDate() {
-        return date;
-    }
-
-    /**
-     * @param date the date to set
-     */
-    public void setDate(Date date) {
-        this.date = date;
-    }
-
-    /**
-     * @return the details
-     */
-    public String getDetails() {
-        return details;
-    }
-
-    /**
-     * @param details the details to set
-     */
-    public void setDetails(String details) {
-        this.details = details;
-    }
-}
diff --git a/src/main/java/no/nibio/vips/entity/WeatherObservation.java b/src/main/java/no/nibio/vips/entity/WeatherObservation.java
index 93761ee..7fb9a33 100755
--- a/src/main/java/no/nibio/vips/entity/WeatherObservation.java
+++ b/src/main/java/no/nibio/vips/entity/WeatherObservation.java
@@ -19,9 +19,11 @@
 
 package no.nibio.vips.entity;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonIgnore;
+
 import java.util.Date;
+import javax.json.bind.annotation.JsonbDateFormat;
+import javax.json.bind.annotation.JsonbTransient;
+
 
 /**
  * Data object that represents a weather observation. Could be measured (historical
@@ -76,7 +78,8 @@ public class WeatherObservation implements Comparable{
         
     public final void setTimeMeasured(Date timeMeasured) { this.timeMeasured = timeMeasured; }
     
-    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ssXXX", timezone="UTC") // Java >= 7
+    //@JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ssXXX", timezone="UTC") // Java >= 7
+    @JsonbDateFormat(value = "yyyy-MM-dd'T'HH:mm:ssXXX")
     public Date getTimeMeasured() { return this.timeMeasured; }
     
     public final void setElementMeasurementTypeId(String elementMeasurementTypeId) { 
@@ -140,7 +143,8 @@ public class WeatherObservation implements Comparable{
         this.value = value;
     }
     
-    @JsonIgnore
+    //@JsonIgnore
+    @JsonbTransient
     public long getValiditySignature()
     {
         long result = 17;
-- 
GitLab