Skip to content

Relations of the EntitySequence #425

Answered by pponec
pponec asked this question in Q&A
Aug 22, 2022 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

I'll try to phrase the question better: how can I get a list of employees filtered by the name of their employer - using the EntitySequence? I would like to use the following query pattern:

val result2 = database.sequenceOf(Employees())
    .filter { (it.supervisorId.referenceTable as Employees).name eq "John" } // NPE !
    .toList()

The problem with this query is that the filter throws a NullPointerException.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@pponec
Comment options

@vincentlauvlwj
Comment options

Comment options

You must be logged in to vote
1 reply
@vincentlauvlwj
Comment options

Answer selected by pponec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants