Enhancement 234 : ENHANCEMENT - Automatically add empty sets instead of null
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.5.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
05/03/2010
Updated 
05/03/2010
Type 
Enhancement
 
Attachments 
No attachments

Refer to http://www.avaje.org/topic-172.html

public Set<Usergroup> getGroups() {
    if ( groups == null ) {
      final BeanSet<Usergroup> set = new BeanSet<Usergroup>();
      set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
      setGroups(set);
    }
    return groups;
  }

Consider changing the enhancer to automatically add the "null protection" type code for *ToMany properties.

 
Rob 13 Mar 00:49
Fixed in HEAD

You can specify checkNullManyFields=false to explicitly turn off this enhancement option.

For example:
To turn off the checkNullManyFields and use debug level of 4 for enhancement ...

debug=4;checkNullManyFields=false

woResponse

Upload a file