Announcement Announcement Module
Collapse
No announcement yet.
getHibernateTemplate.find does not works Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • getHibernateTemplate.find does not works

    hi,

    I have wrote searching merthod for class Product
    Code:
    public List<Product> findAccounts(String search) {
    return getHibernateTemplate().find("from Product where productid like ? order by productid", new Object[]{search});
    }
    It return no result
    how to correct my code ?

  • #2
    Code:
    return getHibernateTemplate().find("from Product where productid like ? order by productid", search);
    this also does not works

    Comment


    • #3
      It does work, you're doing something wrong. Please provide more details like your schema and what your model looks like.

      Comment


      • #4
        Sorry I have found solution
        the correct one should be

        Code:
        return getHibernateTemplate().find("from Product where productid like ? order by productid", "%"+search+"%");

        Comment

        Working...
        X