facebook

question on hibernate Subqueries use method

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #303160 Reply

    amir55
    Participant

    dear all love friends

    I have next code syntaxly corrct but it gives always null result

    The code is meant to give list of rows where filed2 equals 5
    then give the result list where field1 less than the top result.

    DetachedCriteria criteria = DetachedCriteria.forClass(className2);
    DetachedCriteria subSelect = DetachedCriteria.forClass(className2);

    subSelect.add(Expression.eq(“number2”, 5));
    criteria.add(Subqueries.propertyLe(“number1”, subSelect));

    List list = getHibernateTemplate().findByCriteria(criteria);

    simply if you may tell me how to get the subSelect touse in the Subqueries method

    so many thanks

    Amir

    #303183 Reply

    Amir,

    For further investion on this issue,I need the following details

    1) Can you mention type of project, Hibernate version,name of Database?
    2) Can you copy and paste your installation detail from MyEclipse > Installation Summary > Installation Details.
    3) What is the exact operation that results in this error? Can you share corresponding log message. For this I would suggest you to do the following

      a. open your log file then press Ctrl+A keys and press Delete key.
      b. Save your blank log file.
      c. Open the IDE and replicate your error.

    then go to the log file and copy and paste the same here.

    4) Did you get any errors in “Problems” view? You can get it from Window>Show View> Problems or press “Alt+Shift+Q,X”.
    5) Can you copy and paste Error related console messages(complete NullPointerException)?
    6)

    The code is meant to give list of rows where filed2 equals 5
    then give the result list where field1 less than the top result.

    Could you explain this with a small example.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: question on hibernate Subqueries use method

You must be logged in to post in the forum log in