made a downgrade to a working version of my code. used it as a new starting point.
found no solution for my problem On Monday, November 28, 2016 at 6:10:22 PM UTC+1, Florian Endres wrote: > > > I have 2 objects which are referencing. > > > I want to create a new DocumentData (with session.Save) all necessary > fields are filled, also the process object. > > > but i'm getting this error: > > not-null property references a null or transient value > ProcessControlService.Domain.Entities.DocumentData._ProcessControlService.Domain.Entities.Process.DocumentDataSetBackref > > > DocumentData mapping: > > <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping > xmlns="urn:nhibernate-mapping-2.2" assembly="ProcessControlService.Domain" > namespace="ProcessControlService.Domain.Entities"> <class name="DocumentData" > table="DocumentData" lazy="true"> <id name="ID" unsaved-value ="0" > type="Int32"> <generator class="native" /> </id> <property name="BarCode" > length="255" not-null="false"/> <!--<property name="ScanDate" length="50" > not-null="false" />--> <property name="Tiff" length="255" not-null="false" /> > <property name="UserID" length="50" not-null="false" /> <property > name="InputType" length="100" not-null="false" /> <property > name="DocumentImage" length="255" not-null="false" /> <property name="Stack" > length="255" not-null="false" /> <many-to-one name="Process" class="Process" > column="ProcessID" not-null="true"/> <property name="DeleteFlag" > type="boolean" not-null="true" /> <property name="CompleteFlag" > type="boolean" not-null="true" /> <property name="LastWrittenModul" > length="50" not-null="false" /> <property name="DateCreated" type="datetime" > not-null="true" /> <property name="DateModified" type="datetime" > not-null="false" /> <set name ="ModulDataSet" fetch="subselect" > cascade="all-delete-orphan"> <key column="DocID" > foreign-key="FK_DocumentData_ModulDataList" not-null="true" /> <one-to-many > class="ModulData"/> </set> <set name ="CommentDataSet" fetch="subselect" > cascade="all-delete-orphan"> <key column="DocID" > foreign-key="FK_DocumentData_CommentDataList" not-null="true" /> <one-to-many > class="CommentData"/> </set> </class> </hibernate-mapping> > > > Process mapping: > > <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping > xmlns="urn:nhibernate-mapping-2.2" assembly="ProcessControlService.Domain" > namespace="ProcessControlService.Domain.Entities"> <class name="Process" > table="Process" lazy="true"> <id name="ID" type="Int32" unsaved-value="0"> > <generator class="native" /> </id> <property name="Name" length="50" > not-null="true" unique-key="UK_Process_Name" /> <property name="Description" > length="50" not-null="false" /> <property name="Category" length="10" > not-null="true" /> <property name="DateCreated" type="datetime" > not-null="true" /> <property name="DateModified" type="datetime" > not-null="false" /> <set name ="ModulAssignmentSet" fetch="subselect" > cascade="all-delete-orphan"> <key column="ProcessID" > foreign-key="FK_Process_ModulAssignmentList" not-null="true" /> <one-to-many > class="ProcessModulAssignment"/> </set> <set name ="DocumentDataSet" > fetch="subselect" cascade="all-delete-orphan"> <key column="ProcessID" > foreign-key="FK_Process_DocumentDataList" not-null="true" /> <one-to-many > class="DocumentData"/> </set> </class> </hibernate-mapping> > > > data at last step before save > > > <https://lh3.googleusercontent.com/-qvXeiw-l2m0/WDwc5Oyx6bI/AAAAAAAAAQw/F7213EKbAU4AfghIUq_2OzSnb3Hg3DSVQCLcB/s1600/grUJr.png> > > > > All not null objects are not null > > > I also tried: > > <many-to-one name="Process" class="Process" column="ProcessID" > not-null="true" cascade="none"/> > > > in the DocumentData mapping but it didn't work out. > > It would be great if someone could help me. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.
