I see, thank you very much for the information! понедельник, 10 декабря 2018 г., 14:22:20 UTC+3 пользователь [email protected] написал: > > Hello > > Can you please help us? > We are working on a C# project, which heavily relies on nHibernate and we > need to migrate from *MySQL* to *Postgres*. nHibernate makes this process > rather easy, however there are some questions that we can’t find answers > for… > > The first problem we’ve encountered is foreign keys. We have a lot of > tables with one-to-one references with the following options: > *On Update = CASCADE* > *On Delete = RESTRICT* > > however Hibernate Attributes Mapping *Key* property attribute *OnDelete* > doesn’t have the *restrict* option and there is no *OnUpdate* attribute… > So what should we do - is manual foreign keys addition the only way? > > Another issue is Auto Increment - how should we enable it in case of > *Postgresql* with nHibernate attributes? This is what we are using now: > > private int id; > [Id(0, Column = “id”, Name = “Id”)] > [Generator(1, Class = “native”)] > public virtual int ID { get { return id; } } > > Last question is related to *ENUM* types - how can we make nHibernate to > generate requests like *CREATE TYPE* type_enum AS ENUM (‘A’,‘B’); and > using them in the INSERT / UPDATE sql requests? > > Thank you > >
-- 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.
