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

Rework query parameter list expansion #851

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

dstepanov
Copy link
Contributor

This PR changes how parameters list expansion works, previous implementation only allowed IN (?) to IN(?,?,?) expansion, but SQL allows the use of ANY (?,?) and also SELECT (?,?,?) etc. depends on the database.
New implementation removes compile-time detection for IN ( and expands (?) into (?,?,?) during runtime for collections and arrays in the same way as Hibernate native query does it.

  • (?) expands to (null) if a collection or an array is empty or null
  • (?) remains the same for 1 item collection or array
  • (?) expands to (?, ?... N) for N size collection or array

@graemerocher graemerocher merged commit d175dae into micronaut-projects:master Dec 9, 2020
@graemerocher
Copy link
Contributor

Nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants