openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: Collection (or Map) relationships and null
Date Mon, 11 Dec 2006 22:22:37 GMT
On Dec 11, 2006, at 2:09 PM, Patrick Linskey wrote:

> If you have a null indicator for the collection / map field, then
> OpenJPA will preserve the null-ness.

What's that?  I see you can specify a column as being not nullable  
but I don't see anything in the spec about null and collections.

> Otherwise, the default value will be dictated by what your no-args
> constructor does (or, equivalently, what your member field
> initializations do).

What about for a bean acquired via load?  Will JPA set an empty  
collection into the field, or do I need to add initialize the field?

Actually, maybe just skip all that :)  What is the best practice for  
Collection and Map fields?

Also what about this question:

>> Also, what happens when someone puts a bad value on the Collection
>> (or Map).  For example, a null in the collection, or an entry in the
>> map where the pk doesn't match the bean added.



View raw message