Map table returned by function to JPA projection interfaces
Let's say I have a
interface SampleOverviewProjection {
val id: Int
val code: String
val creationDate: Date
val fooId: Int
val barId: Int?
val bazId: Int?
}
Where Sample, Foo Bar and Baz are more or less unrelated entities (inasfar as database relations are concerned) that are collected onto this Overview because the client wishes it.
Because the query that connects them is somehow convoluted, we want to defer the logic that fetches the overview to the database, where...