Would you use NHibernate for a project with a legacy database, which is partly out of your control?

后端 未结 3 1088
故里飘歌
故里飘歌 2021-01-05 21:11

For me the answer is currently: No, I would use iBatis, because NHibernate is a pain, when the database model and the object model are not in synch. If I don\'t have full co

3条回答
  •  佛祖请我去吃肉
    2021-01-05 22:08

    Yes, consider NHibernate. It's the gold standard for a reason. I have heard that iBATIS supports crazy mapping possibilities, but with NHibernate's IUserType you can map anything, even really strange columns.

    @Ahmad, the entire point of ORM is to prevent a tight coupling between your objects and your schema. If you have this problem you're doing it wrong.

    Also, with NHibernate there are plenty of options for custom queries, formula properties and stored procedures. HQL is extremely powerful and Criteria is flexible.

    I think you'll be doing your clients a disservice if you don't at least spike NHibernate.

提交回复
热议问题