How execute subquery in select using Ormlite. I try this
QueryBuilder<Group, Long> queryBuilder = groupDAO.queryBuilder();
queryBuilder.selectColumns(BaseColumns._ID ,Group.COLUMN_TITLE, "(SELECT relation_type FROM groupmembership as gr WHERE `group`._ID = gr.group_id AND gr.user_id = 687)");
but get exception
java.lang.IllegalArgumentException: Unknown column name '(SELECT relation_type FROM groupmembership as gr WHERE `group`._ID = gr.group_id AND gr.user_id = 687)' in table groups
By the way. I know about rawQuery
(), but I want use QueryBuilder
It is impossible because
QueryBuilder.selectColumns()
check column names before adding to query.I found this in source