-->
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: HibernateTemplate().update(Object) function
PostPosted: Sun Aug 08, 2004 8:13 am 
Regular
Regular

Joined: Mon Aug 02, 2004 9:33 am
Posts: 69
Hibernate version:2

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="catalog.model.businessobject">
<class name="User"
table="users">

<id name="userid" column="ID"
unsaved-value="null"
type="string">
<generator class="assigned"/>
</id>

<property name="password"
column="PASSWD"
not-null="true"
type="string"
length="20"/>

<property name="email"
column="EMAIL"
unique="true"
not-null="true"
type="string"
length="50"/>

<property name="activate_code"
column="ACTIVATE_CODE"
not-null="true"
type="string"/>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
public void updateUser(User user) {
this.getHibernateTemplate().update(user);
}


Full stack trace of any exception that occurs: NIL

Name and version of the database you are using: mysql-4.0.20c

Debug level Hibernate log excerpt: NIL

Hi guys,

I am using JSF + Spring + Hibernate. I got a User backing bean for JSF interface. Th eproblem here is that everytime user update their profile, I gotta get all the value in user POJO class including the activate_code, which is not needed, then pass back to Hibernate update function as a class (User) for Hibernate to update the user profile. if I don't set the value for activate_code in the backing bean, Hibernate will throw an exception saying that the activate_code is null. Any alternate way to tackle this issue? I am quite new to Hibernate and just started using for 2 months. Thanks !

regards,
PrettyHandling


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.