开发者

SubSonic 3 ActiveRecord Fluent Query Multiple Join

I'm trying to do a multiple join to a second column that is referenced from the first join. So in effect find out which stores the product is in.

var q = new MyDB().SelectColumns(Store.NameColumn)
.From<Product>()
.InnerJoin<Shelf>(Product.ShelfIdColumn, Shelf.IdColumn)
.InnerJoin<Store>(Shelf.StoreIdColumn, Store.IdColumn)
.Where(Product.IdColumn).I开发者_StackOverflow社区sEqualTo(5);

The problem is that SubSonic is trying to join the Store table directly to the Product table. I see in the source the comment:

//the assumption here is that the FromTable[0] is the table to join from

So every join is going to be attempted on the Product table. 2.1 had the option of passing in qualified names for the join. Is there a way around this or should I start writing my own fix to allow me to pass in qualified names again?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜