我正在開發使用SSMS 2008 R2的TSQL查詢,我想優化這個存儲過程,目前使用了很多左聯接。有一個包含一個行/查找值的查找表。所以,我的TSQL代碼如下所示: Table A = main record table
Table B = Lookup Table
row1 x unique_identifier, y varchar(100)
row2 x unique_
我有2個EF實體: public partial class CustomerEntity
{
public int CustomerId { get; set; }
public string CustomerName { get; set; }
public virtual ICollection<RoleEntity> Roles { get; set; }
問題是:給定兩個模型A和B在HABTM關聯中,當我創建A的新實例時,如何指示Rails不要寫入A,B和A_B,而僅僅寫入A和A_B? 所以,更確切地說:我有兩個關聯模型:氣球和彩色 class Balloon < ActiveRecord::Base
has_and_belongs_to_many :colors
end
class Color < ActiveRecord::Bas