开发者

SubSonic 3 ActiveRecord Fluent Query Multiple Join

开发者 https://www.devze.com 2023-02-26 05:50 出处:网络
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.

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

精彩评论

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

关注公众号