Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:[/b]
Hibernate-2.1.6
[b]Mapping documents:[/b]
Map hbm
<class name="com.cwitg.xxt.base.Usr" table="usr" dynamic-update="true">
<id column="usr_id" name="id" type="long">
<generator class="UserDefined"/>
</id>........
-------------------------------------------------
parent Form Bean
public class Usr_ implements Serializable {
/** identifier field */
protected Long id;
/** nullable persistent field */
protected String status;
/** nullable persistent field */
protected String loginid;
/** nullable persistent field */
protected String password;
....
public void setPassword(String password) {
this.password = password;
}
... ...
child Form Bean
public class Usr extends Usr_ {
// my operation logic...
//overwriting the setPassword() method in chlid project
public void setPassword(final String inPassword) {
super.setPassword(MD5.encode(inPassword));
}
[b]Code between sessionFactory.openSession() and session.close():[/b]
login check:
public static Usr login(String loginid, String password) {
Usr usr = null;
String db_pwd = null;
XQuery xq = new XQuery();
List usrs = xq.getDBList("select usr from com.cwitg.xxt.base.Usr usr where usr.loginid='" + loginid + "' and usr.status='ACT'");
if (usrs.size() == 0) {
return null;
}
usr = (Usr) usrs.get(0);
db_pwd = usr.getPassword();
password = MD5.encode(password);
if (!password.equals(db_pwd)) usr = null;
return usr;
}
[b]Full stack trace of any exception that occurs:[/b]
2005-1-27 13:43:00 net.sf.hibernate.util.ReflectHelper getBulkBean
信息: reflection optimizer disabled for: com.cwitg.xxt.base.Usr, BulkBeanExcepti
on: null (property setPassword)
[b]Name and version of the database you are using:[/b]
sql-server2000
[b]The generated SQL (show_sql=true):[/b]
Hibernate: update usr set password=? where usr_id=?
[b]Debug level Hibernate log excerpt:[/b]
2005-1-27 13:43:00 net.sf.hibernate.util.ReflectHelper getBulkBean
信息: reflection optimizer disabled for: com.cwitg.xxt.base.Usr, BulkBeanExcepti
on: null (property setPassword)