Hi
I am use hibernateTemplate.load(User.class, userId)
and get the user object
but
now I want to use this method or any other method in hibernate template for username which is not primary key but unique value in database.
like hibernateTemplate.load(User.class, userName)
but its not possible and its give me exceptinon that :
org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type for class gd.bean.User. Expected: class java.lang.Integer, got class gd.bean.User; nested exception is org.hibernate.TypeMismatchException: Provided id of the wrong type for class gd.bean.User. Expected: class java.lang.Integer, got class gd.bean.User
can any one give me idea... how to do that.
|