-->
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: Dynamic Update conflicts with unsaved-value property
PostPosted: Wed Apr 08, 2009 2:32 am 
Newbie

Joined: Tue Apr 07, 2009 7:05 am
Posts: 3
Hibernate version:
3.2.4

Mapping documents:
<class table="ABC" name="com.xxx.ABC" dynamic-insert="true" dynamic-update="true">

<id type="java.lang.Long" column="ABC_ID" access="property" name="abcId" unsaved-value="null">
<generator class="sequence">
<param name="sequence">ABC_ID_SEQ</param>
</generator>
</id>
<version type="java.lang.Long" column="HIBERNATE_VERSION" access="field" name="hibernateVersion"/>

...
</class>

I have noticed that if unsaved-value property is present at id or version declaration then dynamic updated doesn't work.

Would like to know the explanation behind it for this behavior.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 08, 2009 4:04 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
How did you notice it? I don't thin it's a wanted behaviour and I guess there is a problem in your testcode?

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 08, 2009 12:29 pm 
Newbie

Joined: Tue Apr 07, 2009 7:05 am
Posts: 3
Thanks for the reply..

To get dynamic update working I guess we don't need to do any thing.

So here is the flow.

1. Start a transaction (in our case it's EJB )
2. load an object
3. Make changes to object and persist it.

So if you change the hbm file with un-saved attribute the dynamic update set to true it wil update all the column.

Following is the code snippet for my unit test case enevironment where actually I'm using transactional template from spring to have transaction.


super.performInTransaction(new TransactionCallBack()
{
public Object perform(PersistenceManager persistenceManager)
throws Exception
{
_memberData.setName("blah");
updateObject(_memberData);
return null;
}});


I haven't tried with higher version as it might be fixed also and if u r aware please let me know.


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.