Jessynoo wrote:
Hi,
I reckon DBSpecific can't really be expected to support multiple RDBMS, as its name states, since it is modelled as the one component that differs.
Sure, but If my project need to support multiple RDBMS, this mean that the db schema over the different RDBMS are identical.
It's true that even with the same schema, different RDBMS will use differend data type, so LLBLGen need to generate different persistenfeInfo object.
But, imagine....
in theory i believe it's possible to extend LLBLGen so I can do something like:
*) Tell to LLBLGen that I'm going to do a multi-RDBMS project
*) Tell to LLBLGen which is the "Master" RDBMS, LLBLGen will use this DB to get schema info
*) Tell to LLBLGen which are the others RDBMS that I'll need to use
Now, LLBLGen can internally use the ProjectConverter to convert the schema info from
Master RDBMS into the schema info of the other RDBMS supported by my project.
Now LLBLGen can generare a single VS project that contain a single DataAccessAdapter, that will rely on different groups of PersistenceInfo Object, one for each supported RDBMS.
And I can config somewhere the RDMBS tha I want to use.
In a smilar situation I can extend the single DataAccessAdapter generated Class, and benefit of that over every supported RDBMS.
I will benefit of a similar solution even in other situation: for example, now, I'm building a dataAdapterFactory class that will give me the right data access adapter (Access or SQL Server). I need that because I have 2 different DataAccessAdapter in 2 different DLL/namespace.
Jessynoo wrote:
Now, coming back to your issue, if you can afford to make your changes in a class inheriting from dataaccessadapterbase which in turn you inherit with your concrete adapters, that should be much less code to maintain.
I'm thinking about this approach.
This solution involve the creation of another project. Inside that project I will define my CommonDataAdapterClass. I must reference this project, that contain only one class, in all my DBSpecific projects. I need to change the template, so that the generated DAA will inherits from my CommonDataAdapterClass.
I didn't like the idea of creating a new project that will hold only one class...
but maybe it's better than copy/paste the class over multiple project
But it may get complicated for the template modification.
My final Project will work with 4 different DB: DataDB, ConfigDB, AuditingDB, DocumentsDB (All access, or all SQL Server).
So I will need 4 different template modification... or it's possilbe to parametrize the template with some user input asked during (or just before) the generation?
Sorry, but I never tried modify a template.
Jessynoo wrote:
Now, have you considered using entity validators? They may fit your needs.
You may also have a class inheriting from entitybase(2) which overrides its on... methods.
cheers
I need to do auditing about changed/inserted/deleted entity. IMHO adapter it's the right place for that.
Thanks, Max