Hello,

For reference, this change comes from #1875 
<https://github.com/nhibernate/nhibernate-core/pull/1875>.

Adding update="false" insert="false" on properties (the many-to-one in your 
case) duplicating the column should fix the duplication error.

We need to add a possible breaking change in the release notes about this. 
We have not anticipated it.

Le vendredi 7 décembre 2018 10:54:01 UTC+1, David_L a écrit :
>
> I updated NH from V5.1.3 to the new V5.2 and i have a problem now.
> My service throws a MappingException while startup:
>
> MappingException: Unable to build the insert statement for class ...Offer: 
> a failure occured when adding the property OfferSearch
> ArgumentException: The column 'OFFER_ID' has already been added in this 
> SQL builder
>
> I know that I use the OFFER_ID twice in my entity. I use this mapping:
>
>     [Class( Table = "OFFER", ... )]
>     public class Offer {
>         [Id(0, TypeType = typeof(long), Column = "OFFER_ID", Name = "Id", 
> UnsavedValueObject = 0)]
>         [Generator(1, Class = "sequence")]
>         [Param(2, Name = "sequence", Content = "SEQ_OFFER")]
>         public virtual long Id { get; set; }
>
> ... 
>         [ManyToOne(Column = "OFFER_ID", ... )]
>         public virtual OfferSearch OfferSearch { get; set; }
>     }
>
> In this case my ManyToOne Relation OfferSearch points to a view mapping 
> that has the same id and contains searchable columns. I only use it in 
> Query-Statements and read only.
>
> Is there a possibility to tell NH5.2 to behave like NH < 5.2? Can I 
> declare the ManyToOne relation as ReadOnly? What do I have to do? I have 
> mappings like this all over my entities...
>
>

-- 
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.

Reply via email to