java - Hibernate session.get() is always returning null -


@entity @table(name = "t019_staff_profile") public class userdetails implements serializable {     private static final long   serialversionuid    = -723583058586873479l;      @id     @column(name = "staff_id", columndefinition="char(8)")     private string              loginid;      @column(name = "password", columndefinition="char(8)")     private string              password;      @column(name = "first_nam")     private string              firstname;      @column(name = "last_nam")     private string              lastname;      @column(name = "bus_og_cd" , columndefinition="char(3)")     private string              profile; 

public userdetails getlogindetails(string loginid)     {         userdetails object =(userdetails)sessionfactory.getcurrentsession().get(userdetails.class, loginid);         return object;     } 

check database see if value exists in database.

select * t019_staff_profile staff_id = <the value of **loginid**>


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -