Julien D
Julien D

Reputation: 1267

Get children of a OneToMany relationship

With Ebean, you can access a OneToMany relationship with an accessor.

What is the best way to do this in Quill ?

Is there a way to do it with the "for-comprehension" syntax ? Should that be handled in classic scala groupBy, afterwards ?

Here is a scastie that works with SqlMirrorContext : https://scastie.scala-lang.org/lEsCs2MqTUutjPnhnPuIzA

I wrote exactly that in my project with PostgresqlJdbcContext, and it fails :

column "x4.author_id" must appear in the GROUP BY clause or be used in an aggregate function

For those who are at the same point, I ended up by groupBy with pure scala (outside the query), which is still acceptable.

Upvotes: 1

Views: 50

Answers (0)

Related Questions