mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: do not override empty (json) collections with null
Original: https://github.com/ebean-orm/ebean/commit/5551c35ec2496a9d62ab0afcaecbed739f17aa7c Signed-off-by: Jonas Pöhler (JPo) <jonas.poehler@foconis.de>
This commit is contained in:
committed by
Jonas Pöhler
parent
4aef0ad459
commit
1fad6e910c
@@ -221,4 +221,18 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
|
||||
DB.delete(bean);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullToEmpty() {
|
||||
EBasicJsonList bean = new EBasicJsonList();
|
||||
bean.setFlags(null);
|
||||
bean.setTags(null);
|
||||
bean.setBeanMap(null);
|
||||
DB.save(bean);
|
||||
|
||||
bean = DB.find(EBasicJsonList.class)
|
||||
.setId(bean.getId()).findOne();
|
||||
|
||||
assertThat(bean.getFlags()).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user