The column 'Currency_ID' has already been added in this SQL builder (Parameter 'columnName') #2732
-
My legacy project has very strange DB Scheme :) class Currency : Items{} <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class xmlns="urn:nhibernate-mapping-2.2" dynamic-update="true" name="Domain.Currency, Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="Items">
<id name="Id" type="System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" unsaved-value="0">
<column name="Item_ID" not-null="true" />
<generator class="identity" />
</id>
<property name="Guid" type="System.Guid, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
<column name="Item_Guid" />
</property>
<property name="Version" type="System.Int64, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
<column name="Item_Version" />
</property>
<join table="Currencies">
<key>
<column name="Currency_ID" />
</key>
<property name="Code" type="System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
<column name="Currency_Code" />
</property>
<many-to-one cascade="none" class="Domain.Caption, Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Caption">
<column name="Currency_ID" />
</many-to-one>
</join>
</class>
</hibernate-mapping> and NHibernate 5.3.8 at NHibernate.SqlCommand.SqlInsertBuilder.AddColumnWithValueOrType(String columnName, Object valueOrType) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
at NHibernate.SqlCommand.SqlInsertBuilder.AddColumnWithValueOrType(String columnName, Object valueOrType)
at NHibernate.SqlCommand.SqlInsertBuilder.AddColumns(String[] columnNames, Boolean[] insertable, IType propertyType)
at NHibernate.Persister.Entity.AbstractEntityPersister.GenerateInsertString(Boolean identityInsert, Boolean[] includeProperty, Int32 j)
--- End of inner exception stack trace ---
at NHibernate.Persister.Entity.AbstractEntityPersister.GenerateInsertString(Boolean identityInsert, Boolean[] includeProperty, Int32 j)
at NHibernate.Persister.Entity.AbstractEntityPersister.PostInstantiate()
at NHibernate.Persister.Entity.SingleTableEntityPersister.PostInstantiate()
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() |
Beta Was this translation helpful? Give feedback.
-
if add |
Beta Was this translation helpful? Give feedback.
-
Hi @NikitaEgorov this is a documented possible breaking change in 5.2.0 nhibernate-core/releasenotes.txt Lines 624 to 629 in d2599c6 The solution you have found is exactly what is recommended. |
Beta Was this translation helpful? Give feedback.
Hi @NikitaEgorov this is a documented possible breaking change in 5.2.0
nhibernate-core/releasenotes.txt
Lines 624 to 629 in d2599c6
The solution you have found is exactly what is recommended.