I have 2 entity ORM: Orders and Users with many to many relationship.
var c = ORMService.newCriteria( "Order" );
var restrictions = [];
c.createAlias( "users", "u" )
arrayAppend(restrictions, c.restrictions.like( "this.Titolo", "%adm%" ));
arrayAppend(restrictions, c.restrictions.like( "u.username", "%adm%" ));
c.disjunction(restrictions);
var f = c
.withProjections( property="ordineID,Titolo,Descrizione,Data,Data_inizio,Data_completamento,u.username" )
.resultTransformer( c.ALIAS_TO_ENTITY_MAP )
.list();
The problem is with projection of many to many propery "u.username". If I remove that property from projections, query get executed correctly, but of course does not return the user.username field.