I have found a solution. The correct query is:
SELECT META(
ipdb).id AS _ID, META(
ipdb).cas AS _CAS,
ipdb.* FROM
ipdbWHERE ...
The best practice is to use the methods of N1qlUtils, you can look at the example below:
Statement statement = N1qlUtils.createSelectClauseForEntity(template.getCouchbaseBucket().name()).
from(Expression.i(template.getCouchbaseBucket().name()))
.where(".....");
createSelectClauseForEntity
and from
methods build the a part of query.
Bye,