stef wrote:
Hi,
Before starting on a coding mission I thought it wise to check to see if there is anything out there already...
We've customised the PersistenceInfo template for the adapter model so that the database name is no longer hardcoded into the Create*EntityBucket methods, instead the database name is picked up from config. This allows the DBSpecific assembly to be used against multiple db instances (dev, qa, loadtest, etc).
You can already do this with the standard templates. Please see "Using the generated code - Application configuration through .config files".
You can also force the name to be cleared, so the name in the connection string is used as the default catalog. See Using the generated code / Adapter / DataAccessAdapter functionality, SqlServer specific.
What I'm about to write is a utility that accepts a DbSpecific assembly and a database connection string and then checks that the two are compatible. I'll use the information generated into the PersistenceInfoFactory class to ensure that the objects in the given database are what the generated ORM layer expects.
Has anyone done something like this already (and willing to share the code)? The code will be pretty similar to the catalogue refresh performed by the TemplateStudio - any tips on how best to do this
I'm not sure if you need this, with the name overwriting code already build in