dabooka (3) [Avatar] Offline
#1
Hi Folks,
just wondering if this is an error or if it's - more likely - my misunderstanding.

On p123 in Chapter 4 Working With Persistent Objects, there is a code example for User of method equals. The text states that the method "falls back to Java identity for transient instances (if id==null)".

However, what I can see in the code example is that if id==null, it returns false.

I would have expected that if id==null, it then returns the result of a Java identity comparison.

Would that not be the case?

Any advice would be much appreciated!

Thanks,
Max