spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

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

Open spring-projects-issues opened this issue 5 years ago • 6 comments
trafficstars

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 avatar Nov 04 '20 02:11 spring-projects-issues

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 avatar Nov 04 '20 09:11 spring-projects-issues

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 avatar Nov 04 '20 11:11 spring-projects-issues

Jens Schauder commented

Very good point

spring-projects-issues avatar Nov 04 '20 13:11 spring-projects-issues

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 avatar Nov 23 '20 16:11 spring-projects-issues