title: Select single item from database with Spring Hibernate Sessionfactory
body: <p>This is in my DAO:</p>
  
  <pre><code>public List&lt;Weather&gt; getCurrentWeather() {  
      return sessionFactory.getCurrentSession().createQuery("from Weather").list();
  }
  </code></pre>
  
  <p>This gets all of the elements from table Weather. But lets say I wanna do something like this(I want only one element from table Weather):</p>
  
  <pre><code>public Weather getCurrentWeather() {    
      return sessionFactory.getCurrentSession().createQuery("from Weather where id = 1").list(); // here should be something else than list()
  }
  </code></pre>
  
  <p><strong>I know there should not be</strong> <code>list()</code> <strong>in the end, but what must I write there, to get only one object?</strong></p>