Results 1 to 4 of 4
  1. #1
    asshwy is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Post crieteriaSearch problem (hibernate)

    I have user value object class which has login info

    along with that other 5 value obeject class extends user now if I implement crieteriaSearch as follows

    public Object crieteriaSearchUser(userVo louserVo) {
    Map<String, Object> loCrieSearch = new HashMap<String, Object>();

    loCrit = sessionFactory.getCurrentSession().createCriteria( userVo.class);

    if (!louserVo.getUserName().equals("") ) {
    loCrit.add(Restrictions.like("userName",louserVo.g etUserName()+"%"));
    }
    loCrieSearch.put("allUserList", loCrit.list());
    logger.debug("class Name :commonDo Function :crieteriaSearchDiscount Status : Exiting ");
    return loCrieSearch;


    it is going to exception saying that userName is not defined in other value object class which extends user class can anyone suggest solution for that
    Thanks in advance

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Please post the exact stacktrace that you get.

  3. #3
    asshwy is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default it is sowing such as i print the exception msg

    org.hibernate.QueryException: could not resolve property: roleId of: hotel.domain.hotelPropertyVo as one crieteria is on role id which is in user value obeject class but it is refering to hotelPropertyVo
    Last edited by asshwy; 05-07-2010 at 11:21 AM.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by asshwy View Post
    org.hibernate.QueryException: could not resolve property: roleId of: hotel.domain.hotelPropertyVo as one crieteria is on role id which is in user value obeject class but it is refering to hotelPropertyVo
    I don't think this is not the complete stack trace. Could you please the complete one.

Similar Threads

  1. Hibernate aplication Problem
    By Prashant.surwade in forum Advanced Java
    Replies: 6
    Last Post: 09-18-2009, 10:32 AM
  2. composite-id problem hibernate
    By javadev in forum JDBC
    Replies: 14
    Last Post: 07-27-2009, 06:30 PM
  3. Hibernate cache problem
    By jispat in forum New To Java
    Replies: 0
    Last Post: 12-29-2008, 11:18 AM
  4. problem in hibernate need help!
    By jrgahan in forum Advanced Java
    Replies: 0
    Last Post: 05-22-2008, 09:00 AM
  5. problem with hibernate and oracle 8i
    By javadev in forum JDBC
    Replies: 4
    Last Post: 08-09-2007, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •