Demo entry 6745415



Submitted by anonymous on May 27, 2018 at 04:25
Language: Java. Code size: 438 Bytes.

public TbUserEntity getByUserName(String name) {
        Session session = HibernateUtil.getSession();
        String hql = "from TbUserEntity where userName = ?";
        Query query = session.createQuery(hql);
        TbUserEntity u = (TbUserEntity) query.uniqueResult();
        return u;

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).