On Tue, 6 Nov 2007, Patrick Linskey wrote:

> > If I use the javaagent as you described, the test passes.  If I omit the
> > javaagent entirely, the test fails (because the m:m field is null).
> 
> Cool, thanks for testing that out. One more question: is this
> happening with a new instance (i.e., one that you call persist() on),
> or on an instance that you've looked up from the DB?

This is happening on an instance that I've looked up from the DB.  I would 
expect the field to be null on a new object that had not yet been 
persisted, unless the collection were already initialized in the 
declaration.

One thing that's also interesting is that if I define the field so that 
it's initialized in the declaration (e.g. Set<Bar> foo = new 
HashSet<Bar>()), it still ends up being null when retrieved from the 
database... so it would appear that it is being explicitly set to a null 
value at some point.  (Though I don't discount the possibility that 
something else could be happening as well.)

   Nick

-- 
"Courage isn't just a matter of not being frightened, you know. It's being
 afraid and doing what you have to do anyway."
   Doctor Who - Planet of the Daleks
This message has been brought to you by Nick Johnson 2.3b1 and the number 6.
http://healerNick.com/       http://morons.org/        http://spatula.net/

Reply via email to