-
Notifications
You must be signed in to change notification settings - Fork 192
QueryDSL support. #1330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryDSL support. #1330
Conversation
17bd375
to
5a8d65c
Compare
d4a3910
to
faeb781
Compare
src/main/java/org/springframework/data/couchbase/repository/support/DBRef.java
Show resolved
Hide resolved
@BeforeAll | ||
static public void beforeAll() { | ||
callSuperBeforeAll(new Object() {}); | ||
ApplicationContext ac = new AnnotationConfigApplicationContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that class also formatted with the spring data formatter? looks odd
} | ||
|
||
// this gives hqCountry == "" and hqCountry is missing | ||
// @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this test commented out?
} | ||
|
||
protected DBRef asReference(Object constant, Path<?> path) { | ||
return null; // converter.toDBRef(constant, getPropertyForPotentialDbRef(path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this throw an unsupported op or something instead of returning null? (not sure how the comment relates)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented out is from the mongo implementation. Our converter does not have a toDBRef (or similar) method. I don't think it is ever used.
I changed this to throw an RuntimeException.
...a/org/springframework/data/couchbase/repository/support/SpringDataCouchbaseQuerySupport.java
Show resolved
Hide resolved
...a/org/springframework/data/couchbase/repository/support/SpringDataCouchbaseQuerySupport.java
Show resolved
Hide resolved
* CouchbaseDocumentSerializer#toSort(List) | ||
*/ | ||
protected Sort createSort(List<OrderSpecifier<?>> orderSpecifiers) { | ||
return null; // TODO serializer.toSort(orderSpecifiers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lots of todos in here
...ain/java/org/springframework/data/couchbase/repository/support/SpringDataCouchbaseQuery.java
Show resolved
Hide resolved
faeb781
to
a37722a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how well the MongoDB serializer fits into Couchbase. I thought that translating Querydsl predicates into N1QL would be the way to go. Left a few dependency and code style comments.
<dependency> | ||
<groupId>com.querydsl</groupId> | ||
<artifactId>querydsl-apt</artifactId> | ||
<version>${querydsl}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be <scope>provided</scope>
to avoid mandatory dependencies on the annotation processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added scope provided
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buildhelper should actually not be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -160,7 +167,6 @@ | |||
<groupId>javax.annotation</groupId> | |||
<artifactId>javax.annotation-api</artifactId> | |||
<version>${javax-annotation-api}</version> | |||
<scope>test</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should actually remain in test
scope. Probably a consequence of how the generated sources are mounted into the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restored scope test.
// (powered by FernFlower decompiler) | ||
// | ||
|
||
package com.querydsl.couchbase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing license headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. This file doesn't belong in the commit.
import org.jetbrains.annotations.Nullable; | ||
import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; | ||
|
||
public abstract class AbstractCouchbaseQuery<K, Q extends AbstractCouchbaseQuery<K, Q>> implements SimpleQuery<Q>, Fetchable<K> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting of this file is off.
a37722a
to
c41d710
Compare
Closes #1288.
c41d710
to
3c9b7f5
Compare
Closes #1288.