I had the following code sample that returns a list of friends from my database use Hibernate and it works get but I know change the function to pass in String which is the user. How can I change the following code to return all friends that username match the String i pass in?
Code:public List<Friend> listFriends() { return (List<Friend>) sessionFactory.getCurrentSession() .createCriteria(Friend.class).list(); }


Reply With Quote
