firstOrNull
Return the first element, or null
if the sequence is empty.
Especially, if a dialect is enabled, this function will use the pagination feature to obtain the very record only. Assuming we are using MySQL, a SQL containing limit 0, 1
will be generated. But if there are no dialects enabled, then all records in the sequence will be obtained to ensure the function just works.
The operation is terminal.
Return the first element matching the given predicate, or null
if element was not found.
Especially, if a dialect is enabled, this function will use the pagination feature to obtain the very record only. Assuming we are using MySQL, a SQL containing limit 0, 1
will be generated. But if there are no dialects enabled, then all records in the sequence matching the given predicate will be obtained to ensure the function just works.
The operation is terminal.