public virtual IStorageProviderCommand <ObjectLookupResult <DataContainer>, IRdbmsProviderCommandExecutionContext> CreateForSingleIDLookup(ObjectID objectID) { ArgumentUtility.CheckNotNull("objectID", objectID); var tableDefinition = _tableDefinitionFinder.GetTableDefinition(objectID); var selectedColumns = tableDefinition.GetAllColumns().ToArray(); var dataContainerReader = _objectReaderFactory.CreateDataContainerReader(tableDefinition, selectedColumns); var comparedColumns = tableDefinition.ObjectIDProperty.SplitValueForComparison(objectID); var dbCommandBuilder = _dbCommandBuilderFactory.CreateForSelect(tableDefinition, selectedColumns, comparedColumns, new OrderedColumn[0]); var loadCommand = new SingleObjectLoadCommand <DataContainer> (dbCommandBuilder, dataContainerReader); return(new SingleDataContainerAssociateWithIDCommand <IRdbmsProviderCommandExecutionContext> (objectID, loadCommand)); }
protected virtual IStorageProviderCommand <IEnumerable <DataContainer>, IRdbmsProviderCommandExecutionContext> CreateForDirectRelationLookup( TableDefinition tableDefinition, RelationEndPointDefinition foreignKeyEndPoint, ObjectID foreignKeyValue, SortExpressionDefinition sortExpression) { var selectedColumns = tableDefinition.GetAllColumns(); var dataContainerReader = _objectReaderFactory.CreateDataContainerReader(tableDefinition, selectedColumns); var dbCommandBuilder = _dbCommandBuilderFactory.CreateForSelect( tableDefinition, selectedColumns, GetComparedColumns(foreignKeyEndPoint, foreignKeyValue), GetOrderedColumns(sortExpression)); return(new MultiObjectLoadCommand <DataContainer> (new[] { Tuple.Create(dbCommandBuilder, dataContainerReader) })); }