Lets suppose that I have a Category table with a column that holds the id of a parent or child category from the same table. This design would allow me to have unlimited levels of Categories, or unlimited levels in a thread, for example.
How can I map this relationship with NHibernate? Are there any disadvantages or warnings that I should take into consideration when doing this?
You map it as ny other many-to-one:
the only warning is to take care with circular references as well as non-lazyloaded collections and properties…