protected string ConcretePropertySelectFragment(string alias, IInclusionChecker inclusionChecker) { int propertyCount = PropertyNames.Length; int[] propertyTableNumbers = PropertyTableNumbersInSelect; SelectFragment frag = new SelectFragment(Factory.Dialect); for (int i = 0; i < propertyCount; i++) { if (inclusionChecker.IncludeProperty(i)) { frag.AddColumns(GenerateTableAlias(alias, propertyTableNumbers[i]), propertyColumnNames[i], propertyColumnAliases[i]); frag.AddFormulas(GenerateTableAlias(alias, propertyTableNumbers[i]), propertyColumnFormulaTemplates[i], propertyColumnAliases[i]); } } return frag.ToFragmentString(); }
// TODO NH: should remove duplication between this and the other overload, // probably using H3 approach (adding indirection through IInclusionChecker interface). protected string ConcretePropertySelectFragment(string alias, ValueInclusion[] inclusions) { int propertyCount = entityMetamodel.PropertySpan; int[] propertyTableNumbers = PropertyTableNumbersInSelect; SelectFragment frag = new SelectFragment(Factory.Dialect); for (int i = 0; i < propertyCount; i++) { if (inclusions[i] != ValueInclusion.None) { //ie. updateable, not a formula frag.AddColumns( GenerateTableAlias(alias, propertyTableNumbers[i]), propertyColumnNames[i], propertyColumnAliases[i] ); frag.AddFormulas( GenerateTableAlias(alias, propertyTableNumbers[i]), propertyColumnFormulaTemplates[i], propertyColumnAliases[i] ); } } return frag.ToSqlStringFragment(); }