-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to stop auto update?
PostPosted: Wed Dec 03, 2003 11:06 pm 
Newbie

Joined: Tue Oct 28, 2003 6:00 pm
Posts: 14
Can I stop auto persistence for a particular class? There are a few attributes of a class that are converted before persisting to the table. The attributes are converted back after session.find(). These returned objects with the converted attributes are considered dirty by Hibernate, and are persisted automatically during the session. The problem is that the persisted objects now end up with unconverted attributes in the table.

Is there a way to stop to specify read-only for session.find() if I can stop auto persistence?

Thanks,
Barry


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 1:37 am 
Newbie

Joined: Tue Oct 28, 2003 6:00 pm
Posts: 14
What is mutable in the class definiton for? Will it help my situation? Do I need a custom persister? Thare are two session.find() calls in the code for the same class/table in a single session, and the auto update happens in the 2nd session.find(). I am clonning the return objects from session.find() to avoid the auto updates, but hope there's a more elegant solution.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 9:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
1. map a private getter and add a public getter doing your data transfo.

2. Non mutable classes cannot be updated at all (only saved and retrieved)
3. Have a look at update and insert attributes in property tag.

3. Interceptors might help

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.