We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using IntelliJ, the Autowired annotation for the jdbcTemplate variable is labeled as an issue.
Autowired
jdbcTemplate
... public static void main(String[] args) { SpringApplication.run(SpringjdbcApplication.class, args); } @Autowired //Field injection is not recommended JdbcTemplate jdbcTemplate; @Override public void run(String... args) throws Exception { log.info("Creating tables"); ...
It says that "Field injection is not recommended". How to solve this?
The text was updated successfully, but these errors were encountered:
I assigned Greg Turnquist to this one, as a way to get a good answer to your question. Once Greg does so, we can close it.
Sorry, something went wrong.
Constructor injection can be used.
// @Autowired // JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate; public RelationalDataAccessApplication(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; }
I'll leave this open and mark it as good for a first time contributor
No branches or pull requests
Using IntelliJ, the
Autowired
annotation for thejdbcTemplate
variable is labeled as an issue.It says that "Field injection is not recommended". How to solve this?
The text was updated successfully, but these errors were encountered: