Spring Batch和Intellij插件

huangapple go评论64阅读模式
英文:

Spring Batch and Intellij Plugin

问题

When using JdbcTemplate in IntelliJ, the IDE is smart enough to recognize and validate SQL statements against a database schema. I'm not able to get the same behavior from IntelliJ for JdbcCursorItemReader and the SQL used to create the Spring batch reader. Is there a setting or 'trick' to get IntelliJ to become aware of the SQL statements like the example below - just like IntelliJ does for JdbcTemplate?

JdbcCursorItemReader<Person> reader = new JdbcCursorItemReader<>();
reader.setDataSource(rosaDataSource);
reader.setSql("SELECT email, id, created_on from users");
reader.setRowMapper(new UserMapper());
reader.setFetchSize(25);
return reader;
英文:

When using JdbcTemplate in Intellij the IDE is smart enough to recognize and validate SQL statements against a database schema. I'm not able to get the same behavior from Intellij for JdbcCursorItemReader and the SQL used to create the Spring batch reader. Is there a setting or 'trick' to get Intellij to become aware of the SQL statements like the example below - just like Intellij does for JdbcTemplate?

    JdbcCursorItemReader&lt;Person&gt; reader = new JdbcCursorItemReader&lt;&gt;();
    reader.setDataSource(rosaDataSource);
    reader.setSql(&quot;SELECT email, id, created_on from users&quot;);
    reader.setRowMapper(new UserMapper());
    reader.setFetchSize(25);
    return reader;

答案1

得分: 3

> 在“上下文操作”弹出菜单中,您可以注入SQL语言支持以获得针对SQL的特定完成,以下是屏幕截图:

Spring Batch和Intellij插件

Spring Batch和Intellij插件

英文:

> Is there a setting or 'trick' to get Intellij to become aware of the SQL statements like the example below - just like Intellij does for JdbcTemplate?

From the "Context Actions" popup menu, you can inject SQL language support in the query to get SQL specific completions, here is a screenshot:

Spring Batch和Intellij插件

Spring Batch和Intellij插件

huangapple
  • 本文由 发表于 2023年7月6日 19:37:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76628435.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定