String of SQL doesn't understand in Intellij

2020-05-08 08:47发布

问题:

everybody. I am making a toy webapp. It uses Spring Boot and Mybatis. Mybatis mapper configures Java Interface. I expect the string of SQL understands in Intellij. But It doesn't it.

I expect a like below. If it understands SQL in IntelliJ I have a benefit for work.

I want to know How to set for it. or no way?

thanks.

回答1:

You can activate this feature with the following steps:

  1. On you query press Alt + Enter keys and choose the option: Inject language or reference:

  1. Select the most appropiet syntax for you, for example: SQL (SQL Files)

  1. Results:

For disable that feature, you should press Alt + Enter keys on your query and choose Un-inject Language/Reference



回答2:

In java file type, use Inject Language intention action to inject appropriate SQL dialect: