From: NHibernate J. <mik...@us...> - 2007-03-13 20:11:36
|
One-Many Requiring Nullable Foreign Keys ---------------------------------------- Key: NH-941 URL: http://jira.nhibernate.org/browse/NH-941 Project: NHibernate Type: Improvement Versions: 1.2.0.Beta2 Reporter: Colin Jack We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. [b]Hibernate version:[/b] 1.2 [b]Mapping documents: Main Table [/b] <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> <id name="Id" column="FeeTemplateDefinitionID"> <generator class="identity" /> </id> <version name="_version" column="Version" access="field" /> <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> <!-- need to map to fee template --> <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> <key column="FeeTemplateSettingID" /> <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> </bag> </class> </hibernate-mapping> [b]Sub Table [/b] <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> <id name="Id" column="FeeTemplateID"> <generator class="identity" /> </id> <version name="_version" column="Version" access="field" /> <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> </class> </hibernate-mapping> [b]Exception: [/b] Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2007-03-20 09:37:32
|
[ http://jira.nhibernate.org/browse/NH-941?page=all ] Sergey Koshcheyev updated NH-941: --------------------------------- Fix Version: LATER Component: Core > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://jira.nhibernate.org/browse/NH-941 > Project: NHibernate > Type: Improvement > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Fix For: LATER > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <nh...@gm...> - 2008-06-13 17:35:29
|
[ http://jira.nhibernate.org/browse/NH-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410#action_16410 ] Fabio Maulo commented on NH-941: -------------------------------- Are you sure this is an issue ? FeeTemplateDefinitionID is not a FK but it is the PK of FeeTemplateDefinition table. I really have some difficult to understand well what you need... > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://jira.nhibernate.org/browse/NH-941 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Priority: Major > Fix For: Indefinite > > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <nh...@gm...> - 2008-06-13 17:35:33
|
[ http://jira.nhibernate.org/browse/NH-941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-941: --------------------------- Fix Version/s: (was: 2.1.0.Alpha1) Indefinite > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://jira.nhibernate.org/browse/NH-941 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Priority: Major > Fix For: Indefinite > > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <nh...@gm...> - 2008-06-13 19:56:28
|
[ http://jira.nhibernate.org/browse/NH-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411#action_16411 ] Colin Jack commented on NH-941: ------------------------------- Took me a while to get my head around this issue again, I think my example is over-complicated. Anyway it isn't a major issue, its just that if it was easy to change the behavior to allow these FK to be non-nullable then it might be useful particularly when using NHibernate with a legacy database. > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://jira.nhibernate.org/browse/NH-941 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Priority: Major > Fix For: Indefinite > > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Theo de R. (JIRA) <nh...@gm...> - 2010-08-21 14:41:51
|
[ http://216.121.112.228/browse/NH-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19694#action_19694 ] Theo de Roo commented on NH-941: -------------------------------- We have had some odd surprises with this issue with our system. Have a Flight object with multiple Booking objects and all Bookings can have multiple Invoices, plus the flight can have a virtual Invoice. The problem is that for ease of reporting we have a FlightID column in the Invoice which is not nullable. Things seem fine when the flight is saved to the DB before the first invoice gets created. However, when both the flight bookings and invoices are created together and we then try to save the complete flight structure then suddenly we get this Invoice.FlightID does not allow NULL exception. Currently it seems that the only way around it is to save the Flight before creating the first invoice, or making this column Nullable (which it really shouldn't be) Also I don't get why this is a problem because all the relations are in place and the Flight already has an ID before the first save happens. Puzzled user... > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://216.121.112.228/browse/NH-941 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Priority: Major > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-31 12:11:51
|
[ http://216.121.112.228/browse/NH-941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-941. ---------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta2 > One-Many Requiring Nullable Foreign Keys > ---------------------------------------- > > Key: NH-941 > URL: http://216.121.112.228/browse/NH-941 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0.Beta2 > Reporter: Colin Jack > Priority: Major > Fix For: 3.2.0Beta2 > > > We are working with a legacy database and due to dependencies (DTS/reports etc) it is very difficult to redesign. > We are also trying to balance good database design with good domain driven design, hoping to find a good balance between the two. > One place that this falls down is when mapping a one-many where the key is in the many end. Regardless of whether this is good database design we do have to deal with it quite a lot in our database and it cannot be engineered out easily, we thus have to map our domain classes tothe database it is now. Unfortunately this means making the foreign key nullable which is obviously a big step back in terms of database quality. > I've read the forum entries about this, including [url]http://forum.hibernate.org/viewtopic.php?t=957582&highlight=foriegn+foreign+key+nullable[/url], but would like to suggest that you try to add support for non-nullable foreign keys in these situations as it would be a big help when working with existing databases. > [b]Hibernate version:[/b] 1.2 > [b]Mapping documents: > Main Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeTemplateDefinition, SevenIM.FeeSettings.Domain" table="FeeTemplateDefinition" lazy="false"> > <id name="Id" column="FeeTemplateDefinitionID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Description" column="Description" access="nosetter.camelcase-underscore"/> > <!-- need to map to fee template --> > <bag name="_feeCalculationSettingTemplates" access="field" cascade="all-delete-orphan" lazy="true"> > <key column="FeeTemplateSettingID" /> > <one-to-many class="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" /> > </bag> > </class> > </hibernate-mapping> > [b]Sub Table [/b] > <?xml version="1.0" encoding="utf-8"?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate, SevenIM.FeeSettings.Domain" table="FeeTemplate" lazy="false"> > <id name="Id" column="FeeTemplateID"> > <generator class="identity" /> > </id> > <version name="_version" column="Version" access="field" /> > <property name="Kind" column="FeeTypeID" access="nosetter.camelcase-underscore"/> > </class> > </hibernate-mapping> > [b]Exception: [/b] > Test method SevenIM.FeeSettings.Persistence.Tests.FeeTemplatePersistenceTests.CanPersist threw exception: NHibernate.ADOException: could not insert: [SevenIM.FeeSettings.Domain.FeeCalculationSettingTemplate] ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'FeeTemplateDefinitionID', table 'CRM.dbo.FeeTemplate'; column does not allow nulls. INSERT fails. > The statement has been terminated.. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |