快速的問題: 如果我有一個一對多的關係,比如這個: class SalesPerson < ActiveRecord::Base
has_many :deals
end
class Deal < ActiveRecord::Base
belongs_to :sales_person
end
我該怎麼刪除銷售人員,而不會對與其相關的交易產生負面影響?如果有人離開了這個
這是我的問題。我有這個模型[Event]有多個[Day],在[Event]中有一個叫做days的關係,並且在[Day]中有一個反向關係事件。 現在我想傳遞Event對象,並使用NSFetchedResultsController獲取所有日子,並在表中提供所有日子。這裏是我的代碼: // Create the fetch request for the entity.
NSFetchRequest
我試圖做的Grails 1.3.4一個多一對多的關係,我得到這個異常: Caused by: org.codehaus.groovy.grails.exceptions.GrailsDomainException: No owner defined between domain
classes [class gblog.Post] and [class gblog.Comentario] in