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

DATAJDBC-395 - AbstractJdbcConfiguration no longer registers a bean of type DataAccessStrategy. #160

Closed
wants to merge 3 commits into from

Conversation

schauder
Copy link
Contributor

This avoids having multiple beans of that type in an ApplicationContext when a custom DataAccessStrategy needs to be provided.

…f type DataAccessStrategy.

This avoids having multiple beans of that type in an ApplicationContext when a custom DataAccessStrategy needs to be provided.
ObjectProvider<RelationResolver> relationResolverProvider, Optional<NamingStrategy> namingStrategy,
JdbcConverter jdbcConverter) {

RelationResolver relationResolver = relationResolverProvider.getIfAvailable(() -> dataAccessStrategy( //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try to avoid these manual breaks in parameters lists? If a list exceeds the line length, we could rather prefer breaking right before the invocation instead:

relationResolverProvider //
  .getIfAvailable(() -> …)


return new JdbcAggregateTemplate(publisher, context, converter, dataAccessStrategy);
return new JdbcAggregateTemplate( //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. I think the single line reads way better than the ones broken out onto multiple ones.

JdbcMappingContext context = jdbcMappingContext(namingStrategy);
return new DefaultDataAccessStrategy(new SqlGeneratorSource(context), context, jdbcConverter, operations);
defaultDataAccessStrategy = new DefaultDataAccessStrategy( //
new SqlGeneratorSource(context), //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract into a local variable to keep the line shorter and avoid the additional manual breaks.

Avoid line breaks in parameter lists.
odrotbohm pushed a commit that referenced this pull request Jul 11, 2019
…f type DataAccessStrategy.

This avoids having multiple beans of that type in an ApplicationContext when a custom DataAccessStrategy needs to be provided.

Original pull request: #160.
odrotbohm pushed a commit that referenced this pull request Jul 11, 2019
Avoid line breaks in parameter lists.

Original pull request: #160.
@odrotbohm odrotbohm closed this Jul 11, 2019
@odrotbohm odrotbohm deleted the issue/DATAJDBC-395 branch July 11, 2019 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants