How to find all Authors that have a specific al-a-carte permission.

Hello,

I’ve tried a number things here ranging from HQL to .findAllWhere(criteria) and I cannot seem to get this to work.

I’ve looked at the following resources:

http://wiki.coldbox.org/wiki/Extras:BaseORMService.cfm

http://wiki.coldbox.org/wiki/Extras:BaseORMService.cfm#criteriaQuery

At one point, I almost got it to work using HQL

authorSvc = controller.getWireBox().getInstance(“AuthorService@cb”);

rows = authorSvc.executeQuery(query=“from cbAuthor where AuthorID in (from cbPermission where permission =‘HBG_TEAM’)”,asQuery=false);

This was the only attempt where I did not get some sort of error, however It returned zero records and I know I have users with HBG_TEAM.

I also tried creating a Criteria and passing it to FindAllWhere, example.

This gets the Permission
c = authorSvc.getPermissionService().newCriteria();

c.eq(“permission”,“HBG_TEAM”);

this creates the criteria passing in the permission I found.

oc = {

permissions=c.list()[1]

};

rows = authorSvc.findAllWhere(criteria=oc);

but then I just get an error: