-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Strategy for delete
PostPosted: Tue Nov 22, 2005 6:45 pm 
Newbie

Joined: Tue Nov 22, 2005 6:23 pm
Posts: 1
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.