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
|