Skip to content
Snippets Groups Projects
Commit 665cf65d authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

As far as we got for now. MAJOR issues with JSONB replacing Jackson still unresolved!

parent 12dbfa7c
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,5 @@ That way multiple projects can share the same settings (useful for formatting ru ...@@ -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. 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.license>nibio_open_source_license.ftl</netbeans.hint.license>
<netbeans.hint.jdkPlatform>JDK_1.8_SUN</netbeans.hint.jdkPlatform>
</properties> </properties>
</project-shared-configuration> </project-shared-configuration>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.8.10</version> <version>2.9.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-validator</groupId> <groupId>commons-validator</groupId>
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.8.10</version> <version>2.9.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.8.10</version> <version>2.9.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
...@@ -67,13 +67,13 @@ ...@@ -67,13 +67,13 @@
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>
<artifactId>javaee-api</artifactId> <artifactId>javaee-api</artifactId>
<version>7.0</version> <version>8.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId> <artifactId>javaee-web-api</artifactId>
<version>7.0</version> <version>8.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -156,8 +156,8 @@ ...@@ -156,8 +156,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.3.2</version>
<configuration> <configuration>
<source>1.8</source> <source>10</source>
<target>1.8</target> <target>10</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
......
/*
* 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;
}
}
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
package no.nibio.vips.entity; package no.nibio.vips.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Date; 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 * Data object that represents a weather observation. Could be measured (historical
...@@ -76,7 +78,8 @@ public class WeatherObservation implements Comparable{ ...@@ -76,7 +78,8 @@ public class WeatherObservation implements Comparable{
public final void setTimeMeasured(Date timeMeasured) { this.timeMeasured = timeMeasured; } 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 Date getTimeMeasured() { return this.timeMeasured; }
public final void setElementMeasurementTypeId(String elementMeasurementTypeId) { public final void setElementMeasurementTypeId(String elementMeasurementTypeId) {
...@@ -140,7 +143,8 @@ public class WeatherObservation implements Comparable{ ...@@ -140,7 +143,8 @@ public class WeatherObservation implements Comparable{
this.value = value; this.value = value;
} }
@JsonIgnore //@JsonIgnore
@JsonbTransient
public long getValiditySignature() public long getValiditySignature()
{ {
long result = 17; long result = 17;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment