iBatis 很容易将对象映射到遗留数据库系统。
最近 NHibernate 1.2 和 2.0 有一个特性集,可能会让你重新思考 iBatis。
NHibernate 与复合键一起工作,这在旧数据库中经常出现,它们并不总是令人愉快的工作,但对此提供支持。
NHibernate 可以利用存储过程对实体以及数据库视图进行 CRUD 操作。
集合可以是自定义存储过程或 SQL 查询。当外键关系不直接映射到另一端的主键时,集合可以使用 property-ref 属性。
其中一些特性可能会影响 nhibernate 的性能/功能,即使用 property-ref 的延迟加载不起作用(根本?),但大多数情况下都有原因。
其他要点:(这与您的旧数据库并不真正相关,但仍然可以帮助决定技术选择)
Nhibernate 社区似乎比 iBatis 丰富得多。我在这两个列表上,与 iBatis 组相比,对 NHibernate 的支持量相当大。所以支持应该更容易。
Also there is a growing amount of contrib/3rd party tools for NHibernate. Things like The NHibernate Profiler, the Nhibernate Query Analyzer, NHibernate Contrib, Fluent NHibernate to name a few.
Perhaps you can expand on what advantages you believe iBatis currently has. NHibernate has certainly been quite active recently and has gained many new features, a lot of which do assist in legacy/hard to modify schemas.
And to answer the question, yes we do use NHibernate with legacy databases that have awful relationships, composite keys, broken relationships. We still also have a small amount of code based on iBatis. We no longer write any more iBatis code though.