i'm beginner in hibernate ORM. i found a class Example(org.hibernate.criterion.Example) . I've searched a lot about the same class but i couldn't find what its real use or any good example. Hibernate documentation is not providing me enough information for understanding this class.
it would be great if any one can provide me a best example and explain what are the uses of the Example class
Thanks in Advance
The example builds the
where
-block.To find every user of age 18 it would be:
In the collection
users
are only users that are18
in age.Hint: The example introspects every field that is not
null
. This means that if the primary-key is anint
it is0
by default and added into the where-block toWHERE age=18 AND id=0
. Make the pk anInteger
to use it properly.