I have a long string in an annotation block, like this one (see query
property):
/**
* @Table(name="messages")
* @Entity
* @NamedNativeQueries({
* @NamedNativeQuery(
* name = "searchMessages",
* resultClass= "__CLASS__",
* query = "SELECT * FROM message WHERE id IN (SELECT post_id FROM (SELECT m.post_id, COUNT(*) AS words FROM phpbb_search_wordmatch m INNER JOIN phpbb_search_wordlist w ON w.id = m.word_id WHERE blah blah blah blah ...."
* )
* })
*/
class Message {
...
which I would like to split across multiple lines to be more readable.
Is it possible to break the query string in multiple lines?
I just found it by myself:
/**
* @Table(name="messages")
* @Entity
* @NamedNativeQueries({
* @NamedNativeQuery(
* name = "searchMessages",
* resultClass= "__CLASS__",
* query = "SELECT * FROM message WHERE id IN (
SELECT post_id FROM (
SELECT m.post_id, COUNT(*) AS words
FROM phpbb_search_wordmatch m
INNER JOIN phpbb_search_wordlist w ON w.id = m.word_id
WHERE blah blah blah blah ...."
* )
* })
*/
class Message {
...
This works as expected.
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