Unknown column 'table' in 'field list'

20 views
Skip to first unread message

Friedrich Merza

unread,
Sep 1, 2016, 8:00:33 AM9/1/16
to Querydsl
Hi,

Im trying to use Querydsl with SQL.
When i execute the Statement:

SQLQuery query = new SQLQuery(connection, dialect);
query.from(QTable.table).list(QTable.table);

the querydsl tries to select : 

Caught MySQLSyntaxErrorException for select `table` from `table`
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'table' in 'field list'

Why is he trying to select 'table' instead of '*'?. I just want to select the whole entity.
When i use this szenario in JPA all works fine.
I am using QueryDSL-Version 3.6.6
My Table class got 2 Columns with name configKey and configValue, there is no column table in the table table.

Can someone help me with this problem?

timowest

unread,
Sep 1, 2016, 2:45:06 PM9/1/16
to Querydsl
If QTable is an APT generated query type for a JPA entity, this won't work.

You will need to use the code generation for Querydsl SQL instead, which maps a SQL schema to Q-types.
Reply all
Reply to author
Forward
0 new messages