I have a POJO for each table and have a DAO for each POJO.
LOV table has one-to-many relationship with almost all tables (around 100 tables) in the datbase.
In the persistence layer I have a LOVData pojo which corresponds to LOV table, but it doesn't have any relationship with any other POJOs.
Almost all the other tables has uni-directional many-to-one relation with LOVData.
When I display the list of rows from LOV table, I want to disable the delete button if it is being used in any another table. For this I will need to go query against almost all DAOs to see if a particular LOV is being used or not. This logic doesn't sound right to me. Has anyone solved this kind of issue.
I didn't want to add 100s of relationship to LOVData either.
This design issue doesn't exist only for LOV, but for all master tables.
Should I rely on the database integrity constraint exception? Does this fall into best practice?
Please advice
Thanks
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: