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

Support List without @MappedCollection(keyColumn=) [DATAJDBC-630] #848

Open
spring-projects-issues opened this issue Nov 4, 2020 · 6 comments
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Veli-Pekka Muli opened DATAJDBC-630 and commented

Currently the only way to have collections that don't have an order column in the database is to make the collection a Set. This is limiting as Set does not allow duplicate elements and Spring Data JDBC shouldn't force the type of the collections that the entities can have like this. If I want to sort the collection in my code then it might be confusing for the reader because I was forced to use Set which usually isn't ordered. @MappedCollection should be optional for Lists


No further details from DATAJDBC-630

@spring-projects-issues
Copy link
Author

Jens Schauder commented

I agree in principle, but it shouldn't be represented by a List but a separate datatype. Hibernate calls it a Bag

@spring-projects-issues
Copy link
Author

Veli-Pekka Muli commented

Doesn't Hibernate Bag map to List? Having some non-standard data type would add Spring Data JDBC as a dependency of my entities

@spring-projects-issues
Copy link
Author

Jens Schauder commented

Very good point

@spring-projects-issues
Copy link
Author

Jens Schauder commented

After some internal discussion we decided that Collection would be a good way to mark a collection has not specifying an order but potentially having multiple identical entries

@spring-projects-issues spring-projects-issues added status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement labels Dec 31, 2020
@Regyl
Copy link

Regyl commented Dec 29, 2024

Hi there, can I try to solve this?

@schauder
Copy link
Contributor

schauder commented Jan 2, 2025

@Regyl Sure, go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants