title: why mybatis has selectOne and selectList together
body: <p>I intended to design a method <code>public List&lt;Booking&gt; getBooking(Integer id)</code> to get booking, I think it is enough. But my co-worker said I should create two methods </p>
  
  <p><code>public Booking getBooking(Integer id)</code> 
  and <code>public List&lt;Booking&gt; getBookingList(Map parameter)</code>, </p>
  
  <p>he said we should be and also mentioned mybatis has <code>selectOne</code> and <code>selectList</code> at the same time too. </p>
  
  <p>I checked the <code>selectOne</code> and <code>selectList</code> of <code>DefaultSqlSession</code> of mybatis, found that it just call the selectList in selectOne and return the first if selectList has one result, otherwise return null or throw an exception.</p>
  
  <p>Hence, I think that there is no strong reason to both have selectOne and selectList.</p>
  
  <p>Therefore my questions are:</p>
  
  <ol>
  <li>Why mybatis has selectOne and selectList rather than selectList only</li>
  <li>Is it a convention or good practice to do that like mybatis, that is when we want to get object, we need to design two methods, one is used to get one object, another is used to get list object</li>
  </ol>