Hello,

sorry for my late response.


schmeling wrote:
> 
> ..., in Hibernate cartridge the overridden hashcode, equals and toString
> methods are only generated if the entity is embedded or if you are using a
> natural key. In entities with automatically generated id, these operations
> will not be overridden which is critical in my opinion.
> 

The hashcode and equals should be derived from an unmutable subset of the
attributes of an entity.
Therefore this subset has to be declared as <<NaturalKey>>.
If all attributes of an entity are the NaturalKey and you do not want to
declare all of them explizit as NaturalKey, you can enable the feature
'FieldsAreNaturalKeys'.
This feature enabled, an entity without an explizit NaturalKey is handeled
as all fields are NaturalKeys.

Enable this feature in the hibernateConfig.txt. Put an '+' in front of the
FieldsAreNaturalKeys.

Do this solve your problem?

Regards
Darius
-- 
View this message in context: 
http://www.nabble.com/Hibernate-Cartridge%28CHB%29-Equals-Hashcode-ToString-tp20830500s17564p20903692.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to