> There are two separate issues: > > 1) Hibernate only tries to optimize materializing proxies during > equals() for the case of reference equality, which is really not all > that useful. > 2) It breaks when trying to do so.
You are completely right and that code is absolutely misguided. I have changed it to do identity equals of the proxies, in the case of equals() not being overridden. > However, #1 is the problem I want to address. A more useful > optimization that hibernate can perform is to skip initializing proxies > during equals() when equals/hashCode follows identity: (snip) > I suspect this is very, very common, and there is no reason to > materialize proxies in either case. But since entities _could_ be > implemented with other equals/hashCode conventions, I figured this > optimization should be an option in the config file. This sounds very reasonable. Make a patch! (Any changes to this stuff must be done in the "v21branch") ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel