cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] git commit: [CXF-6037] Support for java.sql.Time
Date Wed, 08 Oct 2014 09:56:48 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ff823ecd4 -> ee6f81428


[CXF-6037] Support for java.sql.Time


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/68fb8a1a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/68fb8a1a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/68fb8a1a

Branch: refs/heads/2.7.x-fixes
Commit: 68fb8a1a8b0268eda80d3972cb6fe345415e1dac
Parents: d2ab3e9
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Oct 8 10:38:29 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Oct 8 10:54:59 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/68fb8a1a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
index 39ad123..1e5055f 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.ext.search.fiql;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.sql.Time;
 import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.ParseException;
@@ -491,6 +492,8 @@ public class FiqlParser<T> implements SearchConditionParser<T>
{
         try {
             if (Timestamp.class.isAssignableFrom(valueType)) {
                 return convertToTimestamp(value);
+            } else if (Time.class.isAssignableFrom(valueType)) {
+                return convertToTime(value);
             } else {
                 return convertToDefaultDate(value);
             }
@@ -512,6 +515,11 @@ public class FiqlParser<T> implements SearchConditionParser<T>
{
         Date date = convertToDefaultDate(value);
         return new Timestamp(date.getTime());
     }
+
+    private Time convertToTime(String value) throws ParseException {
+        Date date = convertToDefaultDate(value);
+        return new Time(date.getTime());
+    }
     
     private Date convertToDefaultDate(String value) throws ParseException {
         DateFormat df = SearchUtils.getDateFormat(contextProperties);


Mime
View raw message