Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi,
Hibernate version:3.0.5
[b]Name and version of the database you are using:
Oracle 10g
Can anyone give me an example of a Criteria Query with an Integer value set on an instance of the Object we are selecting?
To make it more clear,
If i have a Class Example.
// Create an instance
Example testExample = new Example();
// suppose Example has an attribute Id and i set the value
testExample.setID(1);
// Now i write the Session Criteria.
List lstsrchExampls = searchSession.createCriteria(Example).add(testExample).list();
Will This work? I tried setting String values instead of numerical values and that worked and gave me a result set based on that string value. I want to know if the above works. As well, will setting values to more than one attribute also generate the result set. Meaning to the above code, i add
testExample.setName("Example");
Will i get a result set satisfying both the coditions or any one of the conditions? Wat will the result set contain?
Thanks,
Surya