Closed

Description
code:
SelectStatementProvider ssp = select(category.id,
category.name,
item.id.as("itemId"),
item.itemName,
itemImg.url.as("imgUrl"))
.from(category, "a")
.leftJoin(item, "b")
.on(category.id, equalTo(item.catId))
.leftJoin(itemImg, "c")
.on(item.id, equalTo(itemImg.itemId))
.where(category.id, isEqualTo(id))
.orderBy(item.createdTime)
.build()
.render(RenderingStrategies.MYBATIS3);
generated sql:
select
a.id, a.name, b.id as itemId, b.item_name, c.url as imgUrl
from
category a
left join
item b
on
a.id = b.cat_id
left join
item_img c
on
b.id = c.item_id
where
a.id = ?
order by
created_time
The tables "item" and "item_img" have the same column "created_time", and the "order by" clause doesn't add table alias as the column's prefix, so it crashed.
Metadata
Metadata
Assignees
Labels
No labels