Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

marcingrzejszczak
Copy link
Contributor

fixes #453

@marcingrzejszczak marcingrzejszczak added the type: enhancement A general enhancement label Oct 16, 2024
marcingrzejszczak and others added 2 commits October 23, 2024 08:50
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);
Copy link
Contributor Author

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.

Copy link
Member

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.

marcingrzejszczak and others added 2 commits October 24, 2024 17:48
@mp911de mp911de added the status: on-hold We cannot start working on this issue yet label Oct 29, 2024
@mp911de mp911de removed the status: on-hold We cannot start working on this issue yet label Nov 18, 2024
@mp911de mp911de added this to the 3.5 M1 (2025.0.0) milestone Nov 18, 2024
mp911de pushed a commit that referenced this pull request Nov 18, 2024
mp911de added a commit that referenced this pull request Nov 18, 2024
Refactor ContextualValueExpressionEvaluator into Function, refactor BindingContext into nested class.

Simplify tests. Rename tests to reflect what they are actually doing. Reformat code.

See #453
Original pull request: #505
@mp911de mp911de closed this Nov 18, 2024
@mp911de mp911de deleted the issue/953 branch November 18, 2024 08:08
mp911de added a commit that referenced this pull request Nov 18, 2024
Refactor ContextualValueExpressionEvaluator into Function, refactor BindingContext into nested class.

Simplify tests. Rename tests to reflect what they are actually doing. Reformat code.

See #453
Original pull request: #505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for parametrized @Query
2 participants