Bug 343 : NPE when Update only Embedded bean after a refresh()
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.7.2
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
05/12/2010
Updated 
05/12/2010
Type 
Bug
 
Attachments 
No attachments

Got test case from Claudio:

Hi Rob, I found the problem shows only when I use
Ebean.refresh(bean).
In my code I refreshed the bean, then applied the changes from the
user interface and eventually saved the bean.
If I take out the refresh I have no errors (the refresh was misplaced,
I needed refreshMany).

I'm uploading a simple test case that shows the error, but here is the
code that fails:

Outer loaded = Ebean.find(Outer.class).findUnique();

// if commented Ebean saves correctly
Ebean.refresh(loaded);

loaded.getEmbeddedBean().setDate2(new Date());

// fails
Ebean.save(loaded);

 
Rob 05 Dec 10:08
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file