-
Notifications
You must be signed in to change notification settings - Fork 55
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
Adds support for parameterized @Query including ValueExpressions #505
Conversation
src/main/java/org/springframework/data/ldap/repository/query/LdapParameters.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/ldap/repository/query/AnnotatedLdapRepositoryQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/ldap/repository/query/BindingContext.java
Outdated
Show resolved
Hide resolved
.../org/springframework/data/ldap/repository/query/ValueExpressionLdapRepositoryQueryTests.java
Outdated
Show resolved
Hide resolved
Refactor ContextualValueExpressionEvaluator into Function, refactor BindingContext into nested class. Simplify tests. Rename tests to reflect what they are actually doing. Reformat code.
@@ -141,27 +108,18 @@ EmbeddedLdapProperties embeddedLdapProperties() { | |||
interface QueryRepository extends LdapRepository<SchemaEntry> { | |||
|
|||
@Query(value = "(cn=:fullName)") | |||
List<SchemaEntry> namedParameters(@Param("fullName") String fullName, @Param("lastName") String lastName); | |||
List<SchemaEntry> namedParameters(String fullName); |
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.
Just FYI I've deliberately added two parameters so that we're sure that the proper one is picked.
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.
Indeed makes sense to have this test, see AnnotatedLdapRepositoryQueryUnitTests.shouldEncodeBase
.
We like to keep integration test rather reduced to the minimum that is necessary. We tend to explore invariants in unit tests.
Tweak wording.
fixes #453