how can i deals with dynamically created tables with LLBL

Posts   
 
    
abdo
User
Posts: 10
Joined: 23-Feb-2009
# Posted on: 16-Mar-2009 17:54:05   

Dear LLBL Pro Team,

I'm facing an issue that, I have tables created at run time. And I need from LLBL to interact with table as if it's a generated entity.

I know that's no way that LLBL can generate that entity before it has been created in DB.

so for that reason I have created a Template table as an structure for the table that will be dynamically created. so can i change the entity name at run time for the template entity by the name of the generated table at run time, so after doing that i will do all my change on the generated table not on the template table.

Thanks and Regards.

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 17-Mar-2009 07:05:19   

Use the Adapter template set and Derive a class from DataAccessAdapter. In there override the GetFieldPersistenceInfo* methods and call the base class' version first. In these overrides, you can then manipulate the table names. It's up to you how you determine when to change which name into which name. ref:Dynamic Tables in dB

Also since you were talking to me about this before, the following are relevant threads that you might find useful.

The following one was about automating the code generation: How to automate the Code Generator

In the following thread, the user was trying to dynamically create entities and give the end user an interface to automate this. Modify project file through code

And this is a good discussion about dynamically handle new tables. DDL at runtime with LLBLGen