why does hibernate not force you to mark fields as virtual, but nhibernate does?
Is this a result of the differences between the VM and CLR?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This isn’t a difference between runtimes – it’s a difference between languages.
In C#, methods aren’t virtual by default. In Java, they are.
Note that neither platform allows fields to be virtual, as described in your question.
Hibernate and NHibernate both require virtual methods – which means making them explicitly virtual in C#.
(Note that in Java the terminology “virtual method” isn’t actually defined in the language specification; here I’m using it to mean “non-final”: a method which can be overridden.)