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

Add JDBC SqlValue classes for arrays [SPR-16904] #21443

Closed
spring-projects-issues opened this issue Jun 5, 2018 · 2 comments
Closed

Add JDBC SqlValue classes for arrays [SPR-16904] #21443

spring-projects-issues opened this issue Jun 5, 2018 · 2 comments
Labels
status: superseded

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jun 5, 2018

Philippe Marschall opened SPR-16904 and commented

We are looking at converting some of our inlist usage to SQL arrays. We were a bit surprised that using arrays with JdbcTemplate requires implementing a custom SqlValue.

We propose introducing two classes.

  • An abstract base class that binds and frees the array but that leaves creating the array to a concrete subclass.
  • A concrete subclass that creates the array using Connection.createArrayOf(String, Object[])

The reason for this is that users might want to or may even have to use vendor extensions for creating arrays. We know of two such vendor extensions that might be interesting:

  • Oracle requires using a vendor method to create an array as Oracle does not support anonymous arrays.
  • PostgreS offers a vendor method for creating arrays from arrays of primitive arrays, therefore eliminating the need for boxing.

We do not propose to include subclasses for them.

Potentially, for convenience reasons java.util.Collection types could also be supported, for now we decided against this.


Affects: 5.0 GA

Referenced from: pull request #1850

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 5, 2018

Philippe Marschall commented

Add PR

@spring-projects-issues spring-projects-issues added in: data type: enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@bclozel bclozel added status: superseded and removed in: data type: enhancement labels Dec 21, 2021
@bclozel bclozel removed this from the 6.x Backlog milestone Dec 21, 2021
@bclozel
Copy link
Member

@bclozel bclozel commented Dec 21, 2021

Closing in favor of #1850

@bclozel bclozel closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded
Projects
None yet
Development

No branches or pull requests

2 participants