You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A B C
--------- -------- ------
Id Name Id Desc Id A B
1 Apple 3 round 5 1 3
2 Banana 4 long 6 2 4
When I make this Query:
new Select().from(A.class)
.join(C.class).on("C.A = A.Id")
.where("C.B = 3")
.execute();
The Id in the resulting A-Model is 5, which is the Id from the C-Model. I guess it's because in the Model.loadFromCursor method the resulting columns are identified by name. However, the name "Id" exists 2 times and it seems to pick the wrong column.
I solved it by making a projection on the columns of the A-Model only in the Select constructor. But it would be nice, if this could be automatically solved.
But nevertheless great library. Greetings, Jan
The text was updated successfully, but these errors were encountered:
Makes the join query unusable if columns have same names because the cursor is picking the wrong column index for the result. Seems to pick the last column in my case.
But I can't think of an elegant solution for this myself :-D
Had to work around with a subquery instead: new Select().from(Project.class).where("Id in (select ProjectId from ProjectToUser)").execute()
I have these tables:
When I make this Query:
The Id in the resulting A-Model is 5, which is the Id from the C-Model. I guess it's because in the Model.loadFromCursor method the resulting columns are identified by name. However, the name "Id" exists 2 times and it seems to pick the wrong column.
I solved it by making a projection on the columns of the A-Model only in the Select constructor. But it would be nice, if this could be automatically solved.
But nevertheless great library. Greetings, Jan
The text was updated successfully, but these errors were encountered: