Skip to content

SQL-290: PolicyOutputDocumentExtensions.SeedForDocumentTesting

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by PolicyOutputDocumentExtensions.SeedForDocumentTesting.

Classification

Field Value
SQL ID SQL-290
Operation type Read
Execution method ORM (NHibernate LINQ)
Database Oracle*
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object PolicyOutputDocumentExtensions
Criteria property N/A — ORM
Lifecycle method SeedForDocumentTesting

Tables

Table Access Columns used
image_category_code ** INSERT ×3 (hypothetical) image_file_code, code; other columns -- unresolved mapping

LINQ statement

Source: Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:76.

// Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:76
uow.GetRepository<ImageCategoryCode>().Seed();

// Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:106-111
public static void Seed(this IRepository<ImageCategoryCode> repo)
{
    repo.Add(new ImageCategoryCode { FileCode = "POLCY", Code = "C" });
    repo.Add(new ImageCategoryCode { FileCode = "POLCY", Code = "P" });
    repo.Add(new ImageCategoryCode { FileCode = "POLCY", Code = "F" });

Sample SQL

Test double — no runtime SQL. This statement executes against TestUnitOfWork/TestRepository<T> (in-memory, List<TEntity>-backed test doubles in SAIF.Framework.Core); no NHibernate session is opened and no SQL is issued at runtime. The SQL below is the hypothetical statement the same expression would produce against a real NHibernate IUnitOfWork using the in-repo mappings, shown to document the mapping shape only — no database table is accessed when this code runs.

Inferred SQL: This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
INSERT INTO image_category_code (
  image_file_code,
  code
  -- unresolved mapping: remaining ImageCategoryCode columns (not documented in Legends)
)
VALUES (
  :FileCode,
  :Code)
-- issued 3 times: ('POLCY','C'), ('POLCY','P'), ('POLCY','F')

Translation notes: - Unresolved mapping (partial): table and composite key resolved via Legends L3; the full property→column list could not be resolved (L4). FileCode→image_file_code and Code→code are the key columns.

Sources

  • Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:76