I have make a change nad now works, however I’m not sure this is correct:
`
var c = userService.newCriteria();
c.add( c.restrictions.like(“this.username”,“admin”) ); // THIS LINE IS CHANGED
var u = c
.createAlias( “role”, “role” )
.withProjections( property=‘username,email,firstName,lastName,role.role’ )
.resultTransformer( c.ALIAS_TO_ENTITY_MAP )
.list();
`
I have added this.username to restrictions and now It’s ok.