Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's wrong with android dao error?

I build my android project, but messages output this following error, this error from android dao.

Error:(31, 19) error: mismatched input 'fromJson' expecting {<EOF>, ';', ',', K_ALTER, K_ANALYZE, K_ATTACH, K_BEGIN, K_COMMIT, K_CREATE, K_DELETE, K_DETACH, K_DROP, K_END, K_EXCEPT, K_EXPLAIN, K_FROM, K_GROUP, K_INSERT, K_INTERSECT, K_LIMIT, K_ORDER, K_PRAGMA, K_REINDEX, K_RELEASE, K_REPLACE, K_ROLLBACK, K_SAVEPOINT, K_SELECT, K_UNION, K_UPDATE, K_VACUUM, K_VALUES, K_WHERE, K_WITH, UNEXPECTED_CHAR}

like image 515
Jess Yuan Avatar asked Oct 24 '25 07:10

Jess Yuan


1 Answers

It is probably a Syntax error in your SQL Query.

Make sure that when you are concatenating your Query (String) that you put a space at the end of each line.

@Query("SELECT c.username, c.first_name, c.last_name, r1.water_amount AS waterAmountLastMonth " +
       "FROM citizen c " +
       "INNER JOIN report r1 ON r1.date_month = :dateMonth " +
       "ORDER BY c.first_name ASC")
like image 82
Haris B. Avatar answered Oct 26 '25 22:10

Haris B.