-
Notifications
You must be signed in to change notification settings - Fork 131
Remove restriction on CollectionLike types #22
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
Conversation
|
Thanks a lot. The mentioned restriction originates from a different context. In Spring Data JDBC we map collections of items to a JOIN table. Leveraging database support for collection-like column types makes sense for R2DBC. We haven't really considered supporting relations (JOINs) through object mapping yet as we need to provide more fundamental functionality first. @schauder we might want to reconsider the mentioned assumption to support collection-typed columns for simple types in Spring Data JDBC. |
|
This also relates to https://jira.spring.io/projects/DATAJDBC/issues/DATAJDBC-259 which is about storing collections of primitive types, but the expectation is that they get stored just as an entity with a single property. How about supporting them via conversions? By registering a CustomConverter for Collection it becomes a simple type. Databases that support Arrays/Lists as column type could then trigger a registration of such a converter. This, in turn, is similar/related to https://jira.spring.io/browse/DATAJDBC-239 and https://jira.spring.io/projects/DATAJDBC/issues/DATAJDBC-284 |
|
Converters apply on a property type basis. One might want to use various strategies in the same application or stick with the same mapping strategy as for databases that don't support array type. A In any case, let's continue the discussion on the actual tickets. |
EntityRowMapper now passes-thru values for Collection-like types such as array. Arrays are supported by Postgres. Original pull request: #22.
Add author tag. Add unit test for EntityRowMapper.
We now support custom conversions via R2dbcCustomConversions. Custom conversions introduces simple types that depend on the used dialect. Custom conversions and simple types are held in RelationalConverter and MappingContext. Simple types and conversions are used by DatabaseClient and repository support to properly apply registered converters and support native types such as array-columns. Related tickets: #22, #26.
EntityRowMapper now passes-thru values for Collection-like types such as array. Arrays are supported by Postgres. Original pull request: #22.
Add author tag. Add unit test for EntityRowMapper.
We now support custom conversions via R2dbcCustomConversions. Custom conversions introduces simple types that depend on the used dialect. Custom conversions and simple types are held in RelationalConverter and MappingContext. Simple types and conversions are used by DatabaseClient and repository support to properly apply registered converters and support native types such as array-columns. Related tickets: #22, #26.
EntityRowMapper now passes-thru values for Collection-like types such as array. Arrays are supported by Postgres. Original pull request: #22.
Add author tag. Add unit test for EntityRowMapper. Original pull request: #31.
We now support custom conversions via R2dbcCustomConversions. Custom conversions introduces simple types that depend on the used dialect. Custom conversions and simple types are held in RelationalConverter and MappingContext. Simple types and conversions are used by DatabaseClient and repository support to properly apply registered converters and support native types such as array-columns. Related tickets: #22, #26. Original pull request: #31.
Now that R2DBC 1.0M6 supports array types, allow CollectionLike types to be handled in EntityRowMapper. I verified that this works for both arrays and collection types such as List.