Closed ForteScarlet closed 1 week ago
Hi. When I try to use a deep level ManyToManyView condition in the query, I get an error: AssertionError: Internal bug: Join property has not storage.
ManyToManyView
AssertionError: Internal bug: Join property has not storage
The test
@Test @Transactional fun queryTest() { // Will be crashed. val err = assertFails { sql.createQuery(SystemPermission::class) { where(table.roles { accounts { id eq 1 } }) select(table) }.execute() } assertIs<AssertionError>(err) assertEquals("Internal bug: Join property has not storage", err.message) // Will work fine. val permissions = sql.createQuery(SystemPermission::class) { where(table.roleMappings { role.accountMappings { account.id eq 1 } }) select(table) }.execute() assertEquals(8, permissions.size) // Throw the error here. throw err }
The entities
Here is a small reproduction package with information on entities and SQL.
Bonus information: the above logic does not crash if ManyToMany is used directly.
ManyToMany
Try 0.9.15
0.9.15
Hi. When I try to use a deep level
ManyToManyView
condition in the query, I get an error:AssertionError: Internal bug: Join property has not storage
.The test
The entities
Here is a small reproduction package with information on entities and SQL.
Bonus information: the above logic does not crash if
ManyToMany
is used directly.