Skip to content

SQL-003: Oracle sequence-based ID generation for ImageAffiliation

This statement is a direct SQL escape hatch used by ImageRepositoryExtensions.GetNextImageAffiliationId to obtain the next long value of the image_affiliation_seq Oracle sequence. Unlike SQL-001 and SQL-002, the ImageAffiliation entity's IMAGE_AFFILIATION_SEQ_NUM identity column also has a native NHibernate sequence generator (GeneratedBy.Native("IMAGE_AFFILIATION_SEQ")), making this statement a parallel/redundant ID-acquisition path to the mapping's own generator rather than the entity's only path to an ID.*

Classification

Field Value
SQL ID SQL-003
Operation type Sequence
Execution method Inline SQL (ISessionStrategy.CreateSqlQuery)
Database Oracle
Schema [unqualified]**
Command type Text
Business object ImageAffiliation (via IRepository<ImageAffiliation> extension)
Criteria property N/A — no IBusinessCriteria exists in this library
Lifecycle method ImageRepositoryExtensions.GetNextImageAffiliationId

Parameters

No parameters — this is a literal, parameterless sequence-name query with no bind variables.

Tables

Table Access Columns used
IMAGE_AFFILIATION SELECT (sequence value only; no table row read) — (image_affiliation_seq.nextval, no column reference)

Sample SQL

select image_affiliation_seq.nextval
from dual

Operations and processes

Business rules

No business rule governs this statement directly — the sequence read is unconditional. The generated value's use is governed by BR-005 once the caller assigns it to a new ImageAffiliation and calls Add().

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Repositories/Imaging/ImageRepositoryExtensions.cs
  • Mappings/Imaging/ImageAffiliationMap.cs