Dynamic Datasource
Contributed by Wil de Bruin
Problem
Solution
Option 1: instanceReady()
component displayname="DynamicQuickBase" extends="quick.models.BaseEntity" {
function instanceReady() {
var thisDataSource = variables._wirebox.getInstance( "coldbox:requestContext" ).getPrivateValue( "mainDatasource","" );
if ( len( thisDataSource) ){
variables._queryoptions["datasource"] = thisDataSource;
variables._builder.setDefaultOptions( variables._queryoptions );
}
}
}Option 2: overriding the newQuery() method
Option 3: Intercepting qb execution
Last updated
Was this helpful?