Gets the first value from the database result. This method should be used when only one result is expected.
Returns:
The first row as an entity wrapped in an Optional if there is at least one row.
Otherwise Optional.empty() is returned. If the value from the database is null, an empty Optional is also returned.