Timur Atakishiev
12/12/2019, 5:12 AMtransaction {
Restaurants.slice(Restaurants.followers.min(),Restaurants.id)
.selectAll()
.groupBy(Restaurants.id)
.first()
}
and I have a simple mapper
private fun toRestaurantUserName(row: ResultRow) = RestaurantUserNameDto(
id = row[Restaurants.id],
numberOfFollowers = row[Restaurants.followers.min()]!!
)
my question is when I want to fetch Restaurants.followers.min(), should I use
row[Restaurants.followers.min()]!!
these one with double !!, or is it better way to write the code?Thank youtapac
12/12/2019, 9:22 AMfollowers
column is nullable and you will run such query then you can get null as a result.
Also, if you will call min()
on a column which comes from a left join
table you will face the same null
value in a result row.Timur Atakishiev
12/12/2019, 11:48 AM