public sqlQuery<T>( sql as String, parameters as klyn.data.sql.SQLParameters = klyn.data.sql.SQLParameters() ) as klyn.data.sql.SQLQuery<T>
Creates a re-executable typed raw SQL query.
Raw SQL is available only for an SQL-backed manager and is intentionally not composable as KQL. The result type must belong to the factory entity model, and values are always bound through a prepared statement.
| Parameter | Description |
|---|---|
<T> | Declared mapped entity result type. |
sql | Explicit SQL text for the configured dialect. |
parameters | Ordered prepared-statement values. |
Typed non-composable SQL query.
users = manager.sqlQuery<User>(
"select * from T_Users where connectionNumber > ?",
SQLParameters(10)
).toList()