cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-6037] Support for java.sql.Time
Date Wed, 08 Oct 2014 09:40:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 665ca4fc9 -> 613a16543


[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/613a1654
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/613a1654
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/613a1654

Branch: refs/heads/3.0.x-fixes
Commit: 613a165435b0f0df361858edf5e6dcecfb609667
Parents: 665ca4f
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:40:35 2014 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/ext/search/AbstractSearchConditionParser.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/613a1654/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
index 2ad62bc..2eda542 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.ext.search;
 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;
@@ -270,6 +271,8 @@ public abstract class AbstractSearchConditionParser<T> implements
SearchConditio
         try {
             if (Timestamp.class.isAssignableFrom(valueType)) {
                 return convertToTimestamp(value);
+            } else if (Time.class.isAssignableFrom(valueType)) {
+                return convertToTime(value);
             } else {
                 return convertToDefaultDate(value);
             }
@@ -292,6 +295,11 @@ public abstract class AbstractSearchConditionParser<T> implements
SearchConditio
         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);
         String dateValue = value;


Mime
View raw message