在Slick中执行过滤器连接时,以下两种方法之间的区别是什么?
val query = for {
c <- coffees if c.price < 9.0
s <- c.supplier -- assuming there is a foreign key
} yield (c.name, s.name)
Run Code Online (Sandbox Code Playgroud)
和
val query = for {
(cof, sup) <- coffees.filter(_.price < 9.0) join supplier on(_.supId === _.id)
} yield (cof.name, sup.name)
Run Code Online (Sandbox Code Playgroud)