isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <>
Subject Re: NullPointerException when trying to persist a domain entity
Date Thu, 12 Sep 2013 12:55:09 GMT
Further to this, I've now changed the framework [1] so that simply newing
up the object will work (rather than requiring newTransientInstance())

There are some (relatively minor) implications to this, in the ticket.

I've also added Javadoc so that this is all more easily discoverable.

Any questions/issues, let me know



On 10 September 2013 20:06, Jeremy Gurr <> wrote:

> Yeah, using newTransientInstance to obtain the entity vs. newing one up
> manually worked. Thanks.
> Automatic recovery would be nice to make it easier for newbies to get up
> to speed with the framework. At a minimum, the javadoc for the persist
> method should indicate that you can't just persist any data entity, but
> that the entity must be obtained from the newTransientInstance method.
> ________________________________________
> From: Dan Haywood []
> Sent: Tuesday, September 10, 2013 11:51 AM
> To: users
> Subject: Re: NullPointerException when trying to persist a domain entity
> How did you instantiate the transient object?  Did you just new it up, or
> did you use container.newTransientInstance()?
> I'm *hoping* the former.  The right thing to do is the latter.
> If the above doesn't sort it out, then could you restate the problem but
> using some different class names.  I got a bit confused with your
> description, which class is the persistable entity (cf Customer), which
> class is the domain service (cf CustomerRepo).
> I agree that we should improve the error messages here.  We might even try
> to automatically recover from the situation (by creating the adapter lazily
> if not present) if we are passed a pojo that was created "outside" of the
> container.  Off the top of my head, I can't see why that won't work (but I
> might be forgetting something).
> Cheers
> Dan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message