Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split long annotation string across multiple lines in a docblock

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?

like image 367
Emanuele Avatar asked May 02 '14 23:05

Emanuele


1 Answers

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.

like image 143
Emanuele Avatar answered Nov 16 '22 15:11

Emanuele