NHibernate中使用generator为assigned的问题

Hibernate version:
1.0.2.0
Mapping documents:
Parent.hbm.xml 
None.gif<? xml version="1.0" encoding="utf-8"  ?>
None.gif
< hibernate-mapping  xmlns ="urn:nhibernate-mapping-2.0" >
None.gif  
< class  name ="HYLQ.Core.Domain.Parent, HYLQ.Core"  table ="Parent" >
None.gif    
< id  name ="Id"  column ="Id"  unsaved-value ="0" >
None.gif      
< generator  class ="assigned"   />
None.gif    
</ id >
None.gif    
< property  name ="Title"  type ="String"  length ="200"   />
None.gif
None.gif    
< bag  name ="Childs"  lazy ="true"  table ="Child"  inverse ="true"  cascade ="all"  
None.gif            access
="NHibernate.Generics.GenericAccessor, NHibernate.Generics"   >
None.gif      
< key  column ="pid"   />
None.gif      
< one-to-many  class ="HYLQ.Core.Domain.Child, HYLQ.Core"   />
None.gif    
</ bag >
None.gif    
None.gif  
</ class >
None.gif
</ hibernate-mapping >


Child.hbm.xml
None.gif<? xml version="1.0" encoding="utf-8"  ?>
None.gif
< hibernate-mapping  xmlns ="urn:nhibernate-mapping-2.0" >
None.gif  
< class  name ="HYLQ.Core.Domain.Child, HYLQ.Core"  table ="Child" >
None.gif    
< id  name ="Id"  column ="Id"  unsaved-value ="0" >
None.gif      
< generator  class ="assigned"   />
None.gif    
</ id >
None.gif    
< property  name ="Memo"  type ="String"  length ="200"   />
None.gif    
< many-to-one  name ="Parent"  column ="pid"  class ="HYLQ.Core.Domain.Parent, HYLQ.Core"
None.gif            access
="NHibernate.Generics.GenericAccessor, NHibernate.Generics"   />
None.gif  
</ class >
None.gif
</ hibernate-mapping >

测试代码:
None.gifusing  (ISession session  =  TestCategory.Factory.OpenSession())
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
InBlock.gif                int id = 1;
InBlock.gif
InBlock.gif                Parent parent = new Parent();
InBlock.gif
InBlock.gif                parent.Id = id;
InBlock.gif                parent.Title = "tetetet";
InBlock.gif
InBlock.gif                Child child = new Child();
InBlock.gif                 child.Id = 1;
InBlock.gif                child.Memo = "222";
InBlock.gif                child.parent = parent;
InBlock.gif
InBlock.gif                parent.Childs.Add(child);
InBlock.gif
InBlock.gif                ITransaction trans = session.BeginTransaction();
InBlock.gif
InBlock.gif                try
ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
InBlock.gif                    session.Save(parent);
InBlock.gif                    trans.Commit();
ExpandedSubBlockEnd.gif                }
InBlock.gif                catch
ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
InBlock.gif                    trans.Rollback();
InBlock.gif                    throw;
ExpandedSubBlockEnd.gif                }
ExpandedBlockEnd.gif            }  

当我设置了
chilid.Id =1的时候,则出现了
Test method TestProject1.TestCategory.AddParentChild threw exception: NHibernate.HibernateException: SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count..
跟踪执行的SQL语句后,发现并不是Insert Child,而是Update Child。
当我将
chilid.Id =1注释后,就正常,不过chilid.Id他用 unsaved-value="0"代替。
执行的SQL语句都是正常的。

而我在网上看到一些One2Many的例子中其中表的主键都是自增长的后非assigned的。
所以这个问题很是困惑,最后,自己写了一个自定义的Generator来生产ID,
后来就没有出现上述的情况了。

你们碰到过这种情况吗?