DBFlow
DBFlow copied to clipboard
Ambiguous columns use the last ambiguous column value as the value
DBFlow Version: 4.2.4
Bug or Feature Request: Bug
Description: When attempting to query a double inner join, the last column "id" is the value no matter which table you are selecting from.
For example: Table 1 is a pivot table:
id, storeId, storeId2
and Table 2 has extra information:
id, store_name, store_coords
So if I want to do a join to combine these two records into one row into a list I would use FlowCursorList
FlowCursorList.Builder<Table1>(SQLite.select()
.from(Table1::class.java)
.innerJoin(Table2::class.java).on(Table2_Table.id).eq(Table1_Table.storeId)
.innerJoin(Table2::class.java).on(Table2_Table.id).eq(Table1_Table.storeId2))
// ...where/orderBy cut for brevity
.build()
This always results in storeId2's Id being selected when using Table1.id
in my adapter. I've tried using aliases, and selecting the columns manually, but nothing seems to fix it.
I;ve run into this issue too, any ways to resolve it?
add .withTable() to property should fix this.