0
試圖使用NHibernate刪除,但被抓住了一個錯誤,如NHibernate的刪除3
「 'tItemVantagem' 沒有映射」
但它是。有什麼建議麼?
_session.Delete(string.Format("DELETE FROM tItemVantagem WHERE IdContraCheque in(select IdContraCheque from tContraCheque where IdCompetencia ={0})", competencia));
_session.Delete(string.Format("DELETE FROM tItemDesconto WHERE IdContraCheque in(select IdContraCheque from tContraCheque where IdCompetencia ={0})", competencia));
_session.Delete(string.Format("DELETE FROM tContraCheque WHERE IdCompetencia ={0}", competencia));
這裏是映射:
public ItemVantagemMAP()
{
Table("tItemVantagem");
Id(x => x.Identificador, c => { c.Generator(Generators.Identity); c.Column("IdItemVantagem"); });
ManyToOne(x => x.TipoVantagem, y => { y.Cascade(Cascade.None); y.Update(false); y.Insert(false); y.Fetch(FetchKind.Join); y.Lazy(LazyRelation.NoLazy); y.Column("IdTpItemVantagem"); });
Property(x => x.HorasPercentual, y => { y.Column("QtHorasPercentual"); });
Property(x => x.Valor, y => { y.Column("VlItemVantagem"); });
}
請爲了解決這個問題,請證明它已被映射以及您嘗試了什麼 –