Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Dev List »

Re: [hibernate-dev] Immutable entities

Steve Ebersole

2008-06-24

Replies: Find Java Web Hosting

Author LoginPost Reply
Mutable entities should be creatable as well as deletable.

The difficulty with immutable and checking for changes (to see whether
we should throw an exception) is that of performance in the case of
simple reattachment of detached entities. This is less an issue in the
case of merge()/saveOrUpdateCopy(). But in the simple case reattachment
this would require a select to know the previous values. So for
consistency-sake (I assume) immutable="true" always just ignores any
potential changes.

We could certainly add a feature for the optional ability to perform the
checking (which I agree would be more desirable, probably, as a user).

--

Steve Ebersole
Project Lead
http://hibernate.org
steve@(protected)

Principal Software Engineer
JBoss, a division of Red Hat
http://jboss.com
http://redhat.com
steve.ebersole@(protected)
steve.ebersole@(protected)


On Tue, 2008-06-24 at 13:05 +0200, Hardy Ferentschik wrote:
> On Mon, 23 Jun 2008 17:05:52 +0200, Steve Ebersole <steve@(protected)>
> wrote:
>
> > What happens if you remove the unecessary save() call after changing the
> > name?
>
> Same, same. The update gets ignore, but no exception is thrown.
>
> There is a ImmutableTest in the core and it seems to also not expect an
> Exception. However, as I mentioned in my other email - updating a mutable
> collection seems to throw an exception. I am also able to delete mutable
> entities. Is this correct?
>
> --Hardy
>
>
>
>

_______________________________________________
hibernate-dev mailing list
hibernate-dev@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-dev
©2008 gg3721.com - Jax Systems, LLC, U.S.A.