Support Equals and GetHashCode

Jan 18, 2012 at 9:35 AM


Thank you for your great tool.

It seems important in some case to override Equals and GetHashCode

How can we handle that two methods ?


Feb 22, 2013 at 8:17 PM
Better late than never. It now generates gethashcode and equals for composite keys.
If your chosen database doesnt automatically detect the composite key you can update the table detail primary key check box manually.
Jun 10, 2013 at 9:25 AM
well i generated some files with the last version (4.0), I confirm that it generate gethashcode and equals when there is composite keys.

as far I understood, we need that 2 function on every entities
please read
In which cases is default implementation of Equals (and GetHashCode) insufficient?
The default implementation is not good enough for NHibernate because it is based on the Object.Equals implementation. This method determines equality for reference types as reference equality. In other words, are these two objects pointing to the same memory location? For NHibernate, the equality should be based on the value(s) of the identity mapping.