我所处理的是遗留的 db, 它使用假记录来显示 somes 空闲关系 。
example: article has a relation to conference.如果一篇文章没有供货商,则为本条指定一个ID0的假供应商,以满足两个表格之间的关系。
在通过 nhibertate 添加新条款时,我必须把这个假供应商装上并指派给新条款,我更希望能够添加一个新条款,而将供应商领域保留为NULL。
因此我正在寻找一个透明地将NULL转换为这个假记录的解决方案,反之亦然。在的帮助下,
我所处理的是遗留的 db, 它使用假记录来显示 somes 空闲关系 。
example: article has a relation to conference.如果一篇文章没有供货商,则为本条指定一个ID0的假供应商,以满足两个表格之间的关系。
在通过 nhibertate 添加新条款时,我必须把这个假供应商装上并指派给新条款,我更希望能够添加一个新条款,而将供应商领域保留为NULL。
因此我正在寻找一个透明地将NULL转换为这个假记录的解决方案,反之亦然。在的帮助下,
您可以在您的实体中添加过滤器, 并启用会话中的过滤器来做到这一点 。
"http://ayende.com/blog/3993/nhibernate-filters" rel="nofollow">nhibernate-filters
Instead of getting into code, I have a simple question. Default behavior for a simple one-to-many is that it inserts the child record then updates the foreign key column with the parent key. Has ...
Given the following Fluent NHibernate maps: public class FastTrackPackageClassMap : ClassMap<FastTrackPackage> { public FastTrackPackageClassMap() { Id(x => x.Id); ...
I had a scenario in Oracle where i need to match a substring part of column with a list of values. i was using sqlfunction projection for applying the substring on the required column, and added that ...
I a persisted NHibernate object that I would like to repersist as a new entity. How do I get NHibernate to save this object as if it was a new? I am thinking I might create a session interceptor to ...
I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...
I have two associated business objects - A and B. the association is (A->B)many-to-one, with B.Id a foreign key in A (so A has A.B_id in the DB). I m using lazy=true and solved most of my problems, ...
Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...
I have my class X : public class ClassX { public virtual IList<ClassY> ListY { get; set; } ... } My ClassX mapping (using Fluent) ... HasMany<ClassX>(x => x.ListY ) ....