Hibernate version:3.0
Name and version of the database you are using:MySQL
Hi All,
I am playing with the Category example from Hibernate in Action where a Category has sub categories etc.
Could someone suggest a way to detect the level (depth) of a Category in the tree?
For example CategoryA has Category B has Category C, I would like to be able to execute a method in the category object as category.getLevel() to return the level of the category.
I could compute the same with an algorithm but do not want to fetch the children or parents if I can avoid it.
Thanks in advance
|