You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ra...@apache.org on 2020/07/17 04:49:34 UTC
[olingo-odata4] branch master updated: [OLINGO-1469]OData V4:
Convert java.time types to correct Edm types
This is an automated email from the ASF dual-hosted git repository.
ramyav pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata4.git
The following commit(s) were added to refs/heads/master by this push:
new 6bc0fc7 [OLINGO-1469]OData V4: Convert java.time types to correct Edm types
6bc0fc7 is described below
commit 6bc0fc72e66524515034037c0932e8a22a806a53
Author: ramya vasanth <ra...@sap.com>
AuthorDate: Fri Jul 17 10:19:23 2020 +0530
[OLINGO-1469]OData V4: Convert java.time types to correct Edm types
---
.../main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
index 46c6361..f886c84 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java
@@ -240,11 +240,13 @@ public class EdmTypeInfo {
return EdmPrimitiveTypeKind.Double;
} else if (value instanceof Float) {
return EdmPrimitiveTypeKind.Single;
- } else if (value instanceof Calendar || value instanceof Date || value instanceof java.sql.Timestamp) {
+ } else if (value instanceof Calendar || value instanceof Date
+ || value instanceof java.sql.Timestamp
+ || value instanceof java.time.ZonedDateTime) {
return EdmPrimitiveTypeKind.DateTimeOffset;
- } else if (value instanceof java.sql.Date) {
+ } else if (value instanceof java.sql.Date || value instanceof java.time.LocalDate) {
return EdmPrimitiveTypeKind.Date;
- } else if (value instanceof java.sql.Time) {
+ } else if (value instanceof java.sql.Time || value instanceof java.time.LocalTime) {
return EdmPrimitiveTypeKind.TimeOfDay;
} else if (value instanceof byte[] || value instanceof Byte[]) {
return EdmPrimitiveTypeKind.Binary;