Skip to content
Permalink
Browse files
[CXF-5430]: Added initial support for OData 2.0 query language. Cover…
…ed most of advanced use cases (JPA)

git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1567912 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Andriy Redko committed Feb 13, 2014
1 parent 045f6d1 commit 4d0254adf94a0c73569161a3ed011e53319bce31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
@@ -175,8 +175,8 @@ public Object visitBinary(BinaryExpression binaryExpression, BinaryOperator oper
property.typeInfo.getGenericType(), conditionType, condition, checkInfo);
}

return new PrimitiveSearchCondition< T >(property.propertyName,
typedValue, conditionType, condition);
return new PrimitiveSearchCondition< T >(property.propertyName, typedValue,
property.typeInfo.getGenericType(), conditionType, condition);
}

@Override
@@ -28,7 +28,6 @@

import org.apache.cxf.jaxrs.ext.search.SearchConditionParser;
import org.apache.cxf.jaxrs.ext.search.odata.ODataParser;
import org.junit.Ignore;
import org.junit.Test;

public class JPATypedQueryVisitorODataTest extends AbstractJPATypedQueryVisitorTest {
@@ -53,28 +52,28 @@ public void testAndQuery() throws Exception {
assertTrue(10 == books.get(0).getId() && "num10".equals(books.get(0).getBookTitle()));
}

@Test @Ignore("Fixing, in progress")
@Test
public void testQueryCollection() throws Exception {
List<Book> books =
queryBooks("reviews.authors eq 'Ted'");
assertEquals(3, books.size());
}

@Test @Ignore("Fixing, in progress")
@Test
public void testQueryCollection2() throws Exception {
List<Book> books =
queryBooks("reviews.book.id eq 10");
assertEquals(1, books.size());
}

@Test @Ignore("Fixing, in progress")
@Test
public void testQueryCollection3() throws Exception {
List<Book> books =
queryBooks("reviews.book.ownerInfo.name eq 'Barry'");
assertEquals(1, books.size());
}

@Test @Ignore("Fixing, in progress")
@Test
public void testQueryElementCollection() throws Exception {
List<Book> books =
queryBooks("authors eq 'John'");
@@ -95,14 +94,14 @@ public void testNumberOfReviews2() throws Exception {
assertEquals(0, books.size());
}

@Test @Ignore("Fixing, in progress")
@Test
public void testQueryCollectionSize2() throws Exception {
List<Book> books =
queryBooks("reviews.authors gt 0");
assertEquals(3, books.size());
}

@Test @Ignore("Fixing, in progress")
@Test
public void testAndQueryCollection() throws Exception {
List<Book> books =
queryBooks("id eq 10 and authors eq 'John' and reviews.review eq 'good' and reviews.authors eq 'Ted'");

0 comments on commit 4d0254a

Please sign in to comment.