Virtual Entity with new datasource

235 Views Asked by At

I have a Users entity that is duplicated across a few different applications where it just inherits the datasource from the application.cfc. I am trying to consolidate some sections of the applications to one spot, so I need to access the entity with different datasources since the one application will access all sections.

component accessors=true persistent=true table="Users" entityName="Users" extends="common.model.BaseActiveEntity"{...}

From what I have found online I should be able to set the datasource for this entity from a Virtual Entity Service like so:

Component singleton=false accessors=true autowire=false Datasource="DB2" extends="common.model.BaseVirtualEntityService"{
    public testUser function init(){
        super.init(argumentCollection=arguments,entityName="Users");        
        return this;
    }
}

but when I dump the entity to the page to see what it contains, it has defaulted back to the datasource set in the application.cfc. I'm trying to figure out if there is a way to force the datasource to the entity. Any ideas?

0

There are 0 best solutions below