SQL-305: TaskExtensions.FillTaskCategory¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by TaskExtensions.FillTaskCategory.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-305 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | TaskExtensions |
| Criteria property | N/A — ORM |
| Lifecycle method | FillTaskCategory |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| TASK_PRIORITY_CODE | SELECT ×2 (hypothetical) | Code, CODE_DESCR |
LINQ statement¶
Source: Data/SAIF.Data/TestRepository/RepositoryExtensions/TaskExtensions.cs:48.
// Data/SAIF.Data/TestRepository/RepositoryExtensions/TaskExtensions.cs:48
var med = uow.GetRepository<TaskPriority>().Query().SingleOrDefault(x => x.Code == "MED");
// Data/SAIF.Data/TestRepository/RepositoryExtensions/TaskExtensions.cs:49
var info = uow.GetRepository<TaskPriority>().Query().SingleOrDefault(x => x.Code == "INFO");
Sample SQL¶
Test double — no runtime SQL. This statement executes against
TestUnitOfWork/TestRepository<T>(in-memory,List<TEntity>-backed test doubles inSAIF.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 NHibernateIUnitOfWorkusing 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
-- line 48: Code == "MED"
SELECT
TPC.Code,
TPC.CODE_DESCR
FROM TASK_PRIORITY_CODE TPC
WHERE TPC.Code = :p0 -- 'MED'
-- SingleOrDefault
-- line 49: Code == "INFO"
SELECT
TPC.Code,
TPC.CODE_DESCR
FROM TASK_PRIORITY_CODE TPC
WHERE TPC.Code = :p0 -- 'INFO'
-- SingleOrDefault
Translation notes:
- String constants (and captured values) are bound as parameters by NHibernate (:p0); the literal is shown in the trailing comment.
Sources¶
Data/SAIF.Data/TestRepository/RepositoryExtensions/TaskExtensions.cs:48