• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Finder query return type..?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using a session bean ProcessBean and an entity bean AlarmBean....
where one of functions processor() of ProcessDataBean is like......
processor()
{
println(.a..);
println(..b.);
correlate();
println(.c..);
}
And correlator() is like:-
correlator()
{
println(..d.);
AlarmBeanLocal l = finder query();
println(.e..);
if(l != null)
{
println(.m..)
}
else
{
println(.n..)
}
}
Finder query returns the reference to the entity bean's local interface.......and depending on whether find is successful or not....I've to print m or n....
Now the problem is whenever find is successful.......e, then m and then c gets printed......
but when finder query is not successful, e and n doesn't get printed....and directly c gets printed...it means finder query is directly returning control to the previous function(processor where c is getting printed) .......
I'm not getting whr. is the problem....
in the condition l != null......?
Plz. help me out...
All the declarations in local and home interfaces and ejb-jar is correct.......and my jar file is deployed successfully.....but the output is not correct.....
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finder methods should throw a FinderException for single entity finders if the object is not found.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by swati jain:

surround
AlarmBeanLocal l = finder query();
with try - catch construct and catch FinderException

 
reply
    Bookmark Topic Watch Topic
  • New Topic