Announcement Announcement Module
Collapse
No announcement yet.
Regarding case insensitive Search Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regarding case insensitive Search

    Hi,
    i am using Hibernate3 with JPA using spring.
    When i search the annotated entity in normal case. It worked fine and showed sql query in the log, with following code:
    Code:
     list = this.getHibernateTemplate().findByExample(Example.create(iEntity));
    but when i added ignorecase in the example, it did worked. Even i did not show SQL in the log.

    Code:
    Example example =	Example.create(iEntity).ignoreCase().enableLike(MatchMode.EXACT);
     list = this.getHibernateTemplate().findByExample(example);

    Anyone help?

    Regards,
    shahzad

  • #2
    solved

    Example example = Example.create(iEntity).ignoreCase().enableLike(Ma tchMode.EXACT);

    list = getSession()
    .createCriteria(iEntity.getClass())
    .add(example).list();

    Comment


    • #3
      please using the Criteria class for your code!

      Comment

      Working...
      X