-
Notifications
You must be signed in to change notification settings - Fork 199
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
Document how to use Spring JdbcTemplate, with multi-language examples. #2494
Conversation
@JdbcRepository(dialect = Dialect.H2) | ||
abstract class AbstractBookRepository implements CrudRepository<@Valid Book, @NotNull Long> { | ||
|
||
private final JdbcTemplate jdbcTemplate; //<2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the JdbcTemplate be injected directly without the need of instantiating it manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that didn't work for me, and even in that case it did, it still needs a DataSource set before you can use it. I patterned this after what is done in: https://github.com/micronaut-projects/micronaut-data/blob/master/data-spring-jdbc/src/main/java/io/micronaut/data/spring/jdbc/SpringJdbcConnectionOperations.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could create a factory that does the same thing, and then it could be injected.
ping @dstepanov |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@sdelamo Looks like these doc-examples/jdbc-spring-template-xxx are failing
|
@radovanradic Is this repeatable for you? I just ran the |
@wetted Not anymore it seems. Was getting it today on 4.1.x consistently. Maybe didn't pick up Sergio's merge. Seems to be working fine now. Sorry for false alarm. |
close #2423