Virtualentity service not caching

I have this virtual entity service:

`

/**

  • A ColdBox Enabled virtual entity service
    */
    component extends=“cborm.models.VirtualEntityService” singleton{

/**

  • Constructor
    */
    function init(){

// init super class
super.init(entityName=“WmWidget”,useQueryCaching=true,queryCacheRegion=“myapp.authors”);

return this;
}

}

`

If I dump the query

`

prc.widgets = widgetManagerService.list(asQuery=true);
dump(prc.widgets);abort;

`

It states it’s not cached:

`
Query
Execution Time: 0 ms
Record Count: 5
Cached: No
Lazy: No

`

So how can I cache a query from orm?

you need to enable the secondary cache in Application.cfc

Luis F. Majano
CEO
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
Social: twitter.com/lmajano facebook.com/lmajano