Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Markus Schmider wrote:When I use the debugger I see that Tatbestand.clone() is never called.
Is my code faulty? I would like to avoid to write a large method which sets all primary keys on the object tree to null.
Well, one possible problem is that List isn't Cloneable. Most implementations of List are; but I'm not sure that that's sufficient (this looks rather like a Hibernate declaration, and I honestly don't know what implementation it uses).
I'm also worried about the "set all primary keys on the object tree to null" bit. It sounds like a recipe for disaster to me, unless you have some mechanism for resetting them ALL to something else before you actually do anything with this "clone".
My suggestion: Why don't you back up and explain what you're trying to do? All we know so far is HOW you want to do it, and it's plainly not working. Deep cloning is NOT simple; and to be honest, I've never tried it with a database object Map.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Do you want ants? Because that's how you get ants. And a tiny ads:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth