Change table name at runtime

Posts   
 
    
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 14-Oct-2013 10:35:35   

I've to connect to a database that have multiple table with the same schema, for each "customer". So I would like to know if there is a way to change the table name before doing the query ? I'm using the Adapter model, v3.5

Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 14-Oct-2013 11:35:52   

If I correctly understood your links, it's all about overwriting the catalog or schema name. I'm searching a way to overwrite the TABLE name.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39888
Joined: 17-Aug-2003
# Posted on: 14-Oct-2013 16:29:41   

No, that's not supported. But why not use a schema per customer?

Frans Bouma | Lead developer LLBLGen Pro
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 14-Oct-2013 16:32:28   

I don't have the choice disappointed

I've started something using a new template in the designed, which is a copy of the original persistanceInfoProvider template but with some modifications.

The generated custom persistenceinfoprovider accept in CTOR a component in charge to "translate" the tables name.

Then, I've a custom DataAccessAdapter which create the custom PersistenceInfoProvider and pass it to the base ctor.

Do you think I'm in the right way ?

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 14-Oct-2013 21:37:48   

This can work indeed.