How similar are the implementations of hibernate and nhibernate?
How similar are the implementations of hibernate and nhibernate?
i.e. if I am comfortable with nhibernate, will hibernate开发者_运维技巧 be a very easy transition?
I've used Hibernate a lot and read up on NHibernate, and as far as the basics go, they appear very similar.
- Mapping files (.hbm.xml) are used in both Hibernate and NHibernate, and appear almost identical for simple configurations (except for XML namespaces).
- While NHibernate configuration isn't done in a hibernate.properties file like in Hibernate, the keys used are the same.
- The same basic interfaces are used between Hibernate and NHibernate, but they just have an 'I' at the beginning in .NET (SessionFactory vs. ISessionFactory).
- Most of the basic methods have the same name in NHibernate, but the .NET methods are capitalized unlike in Java (
session.Save(user)
vs.session.save(user)
).
精彩评论