Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

find()-method and RecordNotFoundException

 
mohammad abdellatif
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DBMain.find method throws a RecordNotFoundException, Shall i through it to indicate no matched records are found, or shall I return an empty array.

 
Roel De Nijs
Sheriff
Posts: 9828
103
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohammad abdellatif wrote:Shall i through it to indicate no matched records are found

That's what I did. Others just returned an empty array. So both approaches are fine, don't forget to document your decision in choices.txt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic