-->
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: Where to check foreign key existance: DAO object or Service?
PostPosted: Mon Dec 01, 2003 5:59 am 
Beginner
Beginner

Joined: Tue Nov 18, 2003 10:16 am
Posts: 33
Location: Cluj-Napoca, Romania
I have an UserDAO and an CountryDAO object.
When I insert an User object into database, first I must check if the Country for that user exists in database (if nobody deleted it).

If I check this in insertUser() method from UserDAO object, I must get a reference of CountryDAO object. This seems wrong to me, because I tight couple two DAO objects.

If I am doing this on a Service layer, using those 2 DAO objects as members in Service, It whould be esier to do this checking at this level, but is this business logic? Is not more Data integrity logic?

Best Regards,

Florin Marcus


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.