ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@gmail.com>
Subject Map nullValue to empty collection
Date Fri, 09 Feb 2007 09:48:32 GMT

I have a setter which does no accept null values for a list, ie:

public void setObjects(List<Object> objects){
    if (objects == null) throw new NullPointerException("null not 
permitted");
    this.objects = objects;
}

I did not find yet any decent way to map a nullvalue to an empty list, I 
was thinking of using a specific TypeHandlerCallback on this property on 
the result map but did not go this route yet.

For now dumbest thing I could do was to remove the check and do nothing 
if objects is null, other possibility include an intermediate holder 
object...or ?

Any suggestions welcome.

-- stephane


Mime
View raw message