I am currently devving in inttelij for java, being a phpstorm user previously I am used to setting up strings the span multiple lines like this (which I am aware is incorrect Java syntax):
@Query("select count(*) from table where
value= :xxx
AND value= :xxx2")
when it expects to be set up like this:
@Query("select count(*) from table where "+
"value= :xxx "+
"AND value2 =:xxx2)
Is there some kind of string editor plugin I can use on intelliJ, or some kind of code formatting option I can use to make this more or less like phpstorm?
I can edit a query and maintain its formatting for a Mysql query string by going Alt+Enter -> Inject Language/Reference Mysql then Alt+Enter again -> Edit Mysql fragment on the injected fragment.
No. This is Java, not PHP so the way string literals are represented in source code is defined very strictly by the Java Language Specification.
It is a compile-time error for a line terminator to appear after the opening " and before the closing matching ".
But all modern IDEs help by breaking the string correctly if you press Enter within a string literal.
(By the way, your query string is wrong, as it reads select count(*) from table wherevalue=...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With