SQL-231: TaskQueryProvider.GetSource¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by TaskQueryProvider.GetSource.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-231 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | TaskQueryProvider |
| Criteria property | N/A — ORM |
| Lifecycle method | GetSource |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
code |
Input | string | N/A | Method argument of TaskQueryProvider.GetSource bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| TASK_SOURCE_CODE | SELECT | Code, CODE_DESCR |
LINQ statement¶
Source: Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs:29-30.
public TaskSource GetSource(string code)
{
return Factory.GetRepository<TaskSource>().Query()
.SingleOrDefault(x => x.Code.ToLower() == code.ToLower());
}
Sample SQL¶
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
SELECT
TSC.Code,
TSC.CODE_DESCR
FROM TASK_SOURCE_CODE TSC
WHERE LOWER(TSC.Code) = LOWER(:code)
-- SingleOrDefault: NHibernate expects at most one row
Translation notes:
- TaskSourceMap (TaskMap.cs:83) declares Id(x => x.Code) with no explicit .Column(name) call (line 88). With no conventions registered, FluentNHibernate's default column name is the property name Code. Oracle treats the unquoted identifier as CODE.
- code.ToLower() may be evaluated client-side and bound pre-lowered; the result is the same either way.
Operations and processes¶
Business rules¶
Sources¶
Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs:29