----- "C N Davies" <[email protected]> wrote:

> From: "C N Davies" <[email protected]>
> To: [email protected]
> Sent: Friday, May 28, 2010 8:18:18 AM GMT -07:00 US/Canada Mountain
> Subject: RE: equals, hashcode, toString, etc, and field access
>
> 
> Yet another reason to drag the JPA spec into the 20th century and do
> away
> with this whole attached / detached state business.

What are you proposing here?  That it should be EAGER only?  Or that it should 
be watching it the entire time?  Or perhaps it should allow entities to be 
Stateful session beans, and load entirely on demand?

> 
> Chris
> 
> 
> 
> -----Original Message-----
> From: Daryl Stultz [mailto:[email protected]] 
> Sent: Friday, 28 May 2010 10:23 PM
> To: [email protected]
> Subject: Re: equals, hashcode, toString, etc, and field access
> 
> On Thu, May 27, 2010 at 8:49 PM, Trenton D. Adams
> <[email protected]>wrote:
> 
> >
> > I mean I know if I'm doing lazy loading, toString won't get all the
> data,
> > cause it hasn't been enhanced.
> 
> 
> Assuming the object is detached, yes. I believe the JPA spec does not
> specify the behavior for attempted access of an unloaded property on
> a
> detached entity. I believe OpenJPA returns null. This makes it very
> difficult to tell if an association is null or not loaded. I have
> configured
> OpenJPA to disallow access to unloaded properties of detached entities
> to
> avoid the confusion. This means a toString method like yours in my
> project
> could crash.
> 
> -- 
> Daryl Stultz
> _____________________________________
> 6 Degrees Software and Consulting, Inc.
> http://www.6degrees.com
> http://www.opentempo.com
> mailto:[email protected]

Reply via email to