title: session.get() returning null in hibernate
body: <p>Im working with hibernate and mysql, and i got it working to put data in the DB via hibernate, but when i try to retrieve data it always returns null...</p>
  
  <pre><code>Session session = HibernateUtil.getSessionFactory().getCurrentSession();
  session.beginTransaction();
  User user = (User) session.get(User.class, username);
  session.getTransaction().commit();
  </code></pre>
  
  <p>User is a class with annotations, but the variable user will always be null, even if i put a username that i know exists in the DB. Username is the ID of the table, so it should find it</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Can it be that i use <code>&lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;</code> in the config? What should i use so the DB create the table only if it does not exist?</p>