-->
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.  [ 1 post ] 
Author Message
 Post subject: Dynamic Update
PostPosted: Tue May 22, 2012 8:44 am 
Newbie

Joined: Tue May 15, 2012 9:43 am
Posts: 3
Hi,
Has anybody successfully implemented dynamic update in hibernate?

I want to update only those columns for which the values are specified.
I am using MySQL.
My hbm is as follows:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Apr 16, 2012 7:14:48 PM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
   <class
      name="com.test.person" table="person"dynamic-insert="true" dynamic-update="true" select-before-update="true">
      <id name="Id" type="java.lang.Long">
         <column name="id" />
         <generator class="identity" />
      </id>
      <property name="code" type="string">
         <column name="code" length="20" unique="true" />
      </property>
      <property name="name" type="string">
         <column name="name" length="20" />
      </property>
      <property name="address" type="string">
         <column name="address" length="40" />
      </property>
      <property name="city" type="string">
         <column name="city" length="40" />
      </property>
</class>

</hibernate-mapping>




Thanks in advance.
Regards,
Annuk


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

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.