spring-data-relational
spring-data-relational copied to clipboard
Support List without @MappedCollection(keyColumn=) [DATAJDBC-630]
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
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
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
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