4.0.13.523 SD.LLBLGen.Pro.DQE.SqlServer.dll
4.0.13.0725 SD.LLBLGen.Pro.ORMSupportClasses.dll
4.0.13.406 SD.LLBLGen.Pro.ORMSupportClasses.Web.dll
DotNet 4.0 vs2010 project
Adapter template
SQL Server 2008 R2
Is it possible to optionally overwrite schema names only for tables that exist in that schema?
Sometimes I want to use a set of Entities with [dbo]. and other time [temporal]. This only on a subset of Entities (They have a distinguishing interface ITemporalized) and only when the application requires it.
I can do this in an override of CreateSelectDQ, FetchEntity and FetchEntityCollection when I have the entity available to see if it's schema needs to be rewritten, but when processing aggregates and maybe joins, then I don't think the entity is available.
I tried doing this in the override but with 60+ tables out of 160 I couldn't face writing 60 Replace lines. I might have to be satisfied with that though:-)
protected override IRetrievalQuery CreateSelectDQ(QueryParameters parameters)
{
var retrievalQuery = base.CreateSelectDQ(parameters);
if (UseTemporalViews)
{
var commandText = retrievalQuery.Command.CommandText;
retrievalQuery.SetCommandText(commandText.Replace("[dbo].[v2_Topic_Base]", "[temporal].[v2_Topic_Base]"));
}
// etc. with all the other temporal.tables
return retrievalQuery;
}