-->
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.  [ 2 posts ] 
Author Message
 Post subject: Regarding Handling Exceptions
PostPosted: Thu Nov 10, 2005 2:37 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 2:21 am
Posts: 22
HI

i'm currently working for an Application with uses Spring and Hibernate . Also we are following layered architecture .
in this my business logic resides in a ServiceImpl which interacts with a repository where it holds a intelligence for fetching and storing persistence data .

i'm using HibernateDAOSupport for all my repositories . so i need to know how to handle exception for the following scenarion say :

public person findByPersonUId(Long personUid) {
List list = null;
String query = "";
list = (Person ) getHibernateTemplate().findByNamedParam(...")

if(list!= null) {
return person ;
}

in this case even though if there is a problem ,a null value is returned . Is there any need for catching any exception out here if so what exception in need to catch .

currently i'm follwoing this
catch(Exception e) {
log.wrtie(""");


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 3:36 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
that list won't be null, it will simply have a size of zero

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


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

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.