cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1406126 - in /cxf/branches/2.6.x-fixes: ./ rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/ rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/ rt/rs/extensions/search/src/main/java/org/apache/...
Date Tue, 06 Nov 2012 13:26:43 GMT
Author: sergeyb
Date: Tue Nov  6 13:26:42 2012
New Revision: 1406126

URL: http://svn.apache.org/viewvc?rev=1406126&view=rev
Log:
Merged revisions 1399195-1399196 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1399195 | sergeyb | 2012-10-17 13:24:46 +0100 (Wed, 17 Oct 2012) | 1 line
  
  [CXF-4578] Adding a query type parameter to SearchConditionVisitor
........
  r1399196 | sergeyb | 2012-10-17 13:25:30 +0100 (Wed, 17 Oct 2012) | 1 line
  
  [CXF-4578] Missing update in management-web
........

Added:
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
      - copied unchanged from r1399196, cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPACriteriaQueryVisitor.java
      - copied unchanged from r1399196, cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPACriteriaQueryVisitor.java
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractComplexCondition.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionVisitor.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/PrimitiveSearchCondition.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchCondition.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchConditionVisitor.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SimpleSearchCondition.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitor.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitor.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitorTest.java
    cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1399195-1399196

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-blocked' - no diff available.

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
Tue Nov  6 13:26:42 2012
@@ -465,7 +465,7 @@ public class AtomPullServer extends Abst
             return null;
         }
 
-        public void accept(SearchConditionVisitor<LogRecord> visitor) {
+        public void accept(SearchConditionVisitor<LogRecord, ?> visitor) {
         }
     }
     

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractComplexCondition.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractComplexCondition.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractComplexCondition.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractComplexCondition.java
Tue Nov  6 13:26:42 2012
@@ -71,7 +71,7 @@ public abstract class AbstractComplexCon
         return SearchUtils.toSQL(this, table, columns);
     }
 
-    public void accept(SearchConditionVisitor<T> visitor) {
+    public void accept(SearchConditionVisitor<T, ?> visitor) {
         visitor.visit(this);    
     }
     

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionVisitor.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionVisitor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionVisitor.java
Tue Nov  6 13:26:42 2012
@@ -24,7 +24,7 @@ import java.util.logging.Logger;
 import org.apache.cxf.common.logging.LogUtils;
 
 
-public abstract class AbstractSearchConditionVisitor <T> implements SearchConditionVisitor<T>
{
+public abstract class AbstractSearchConditionVisitor <T, E> implements SearchConditionVisitor<T,
E> {
 
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractSearchConditionVisitor.class);
     
@@ -60,4 +60,8 @@ public abstract class AbstractSearchCond
     public void setPrimitiveFieldTypeMap(Map<String, Class<?>> primitiveFieldTypeMap)
{
         this.primitiveFieldTypeMap = primitiveFieldTypeMap;
     }
+    
+    public SearchConditionVisitor<T, E> visitor() {
+        return this;
+    }
 }

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/PrimitiveSearchCondition.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/PrimitiveSearchCondition.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/PrimitiveSearchCondition.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/PrimitiveSearchCondition.java
Tue Nov  6 13:26:42 2012
@@ -95,7 +95,7 @@ public class PrimitiveSearchCondition<T>
         return SearchUtils.toSQL(this, table, columns);
     }
 
-    public void accept(SearchConditionVisitor<T> visitor) {
+    public void accept(SearchConditionVisitor<T, ?> visitor) {
         visitor.visit(this);    
     }
    

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchCondition.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchCondition.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchCondition.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchCondition.java
Tue Nov  6 13:26:42 2012
@@ -90,6 +90,6 @@ public interface SearchCondition<T> {
      * a custom expression, for example, into the SQL statement, etc 
      * @param visitor
      */
-    void accept(SearchConditionVisitor<T> visitor);
+    void accept(SearchConditionVisitor<T, ?> visitor);
     
 }

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchConditionVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchConditionVisitor.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchConditionVisitor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchConditionVisitor.java
Tue Nov  6 13:26:42 2012
@@ -24,9 +24,15 @@ package org.apache.cxf.jaxrs.ext.search;
  * specific query language such as SQL, etc
  */
 
-public interface SearchConditionVisitor<T> {
+public interface SearchConditionVisitor<T, E> {
     /*
-     * Callback providing a current SearchCondition object 
+     * Accept a current SearchCondition object 
      */
     void visit(SearchCondition<T> sc);
+    
+    /**
+     * Return a built query object 
+     * @return the query
+     */
+    E getQuery();
 }

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SimpleSearchCondition.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SimpleSearchCondition.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SimpleSearchCondition.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SimpleSearchCondition.java
Tue Nov  6 13:26:42 2012
@@ -290,7 +290,7 @@ public class SimpleSearchCondition<T> im
         }
     }
 
-    public void accept(SearchConditionVisitor<T> visitor) {
+    public void accept(SearchConditionVisitor<T, ?> visitor) {
         visitor.visit(this);
     }
     

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitor.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitor.java
Tue Nov  6 13:26:42 2012
@@ -37,7 +37,7 @@ import org.apache.cxf.jaxrs.ext.search.O
 import org.apache.cxf.jaxrs.ext.search.PrimitiveStatement;
 import org.apache.cxf.jaxrs.ext.search.SearchCondition;
 
-public class JPATypedQueryVisitor<T> extends AbstractSearchConditionVisitor<T>
{
+public class JPATypedQueryVisitor<T> extends AbstractSearchConditionVisitor<T, TypedQuery<T>>
{
 
     private EntityManager em;
     private Class<T> tClass;

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitor.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitor.java
Tue Nov  6 13:26:42 2012
@@ -28,7 +28,7 @@ import org.apache.cxf.jaxrs.ext.search.S
 import org.apache.cxf.jaxrs.ext.search.SearchUtils;
 
 
-public class SQLPrinterVisitor<T> extends AbstractSearchConditionVisitor<T> {
+public class SQLPrinterVisitor<T> extends AbstractSearchConditionVisitor<T, String>
{
 
     private StringBuilder sb;
     private String table;

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitorTest.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitorTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPATypedQueryVisitorTest.java
Tue Nov  6 13:26:42 2012
@@ -28,6 +28,7 @@ import javax.persistence.Persistence;
 import javax.persistence.TypedQuery;
 
 import org.apache.cxf.jaxrs.ext.search.SearchCondition;
+import org.apache.cxf.jaxrs.ext.search.SearchConditionVisitor;
 import org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser;
 
 import org.junit.After;
@@ -174,7 +175,7 @@ public class JPATypedQueryVisitorTest ex
     
     private List<Book> queryBooks(String expression) throws Exception {
         SearchCondition<Book> filter = new FiqlParser<Book>(Book.class).parse(expression);
-        JPATypedQueryVisitor<Book> jpa = new JPATypedQueryVisitor<Book>(em, Book.class);
+        SearchConditionVisitor<Book, TypedQuery<Book>> jpa = new JPATypedQueryVisitor<Book>(em,
Book.class);
         filter.accept(jpa);
         TypedQuery<Book> query = jpa.getQuery();
         return query.getResultList();

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java?rev=1406126&r1=1406125&r2=1406126&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/sql/SQLPrinterVisitorTest.java
Tue Nov  6 13:26:42 2012
@@ -38,7 +38,7 @@ public class SQLPrinterVisitorTest exten
     public void testSQL1() throws SearchParseException {
         SearchCondition<Condition> filter = parser.parse("name==ami*;level=gt=10");
         SQLPrinterVisitor<Condition> visitor = new SQLPrinterVisitor<Condition>("table");
-        filter.accept(visitor);
+        filter.accept(visitor.visitor());
         String sql = visitor.getQuery();
         
         assertTrue("SELECT * FROM table WHERE (name LIKE 'ami%') AND (level > '10')".equals(sql)



Mime
View raw message