title: How do I get a Hibernate Entity Class from a string name
body: <p>This has probably been asked before, but I've taken a look and I can't see any concise answers, so I will ask again.</p>
  
  <p>I have a web-service that is taking a String, and a array of field names and data.  I am creating a Hibernate Criteria, and I need an entity implementation.</p>
  
  <p>So, lets say I do:</p>
  
  <pre><code>Criteria criteria = session.createCriteria(MyHibernateEntity.class);
  </code></pre>
  
  <p>"MyHibernateEntity" refers to a hibernate-annoted class which maps to some table in my database.   </p>
  
  <p>What I'd like to do is get:  MyHibernateEntity.class<br>
  from:   "MyHibernateEntity"   which is a string.</p>
  
  <p>One solution I saw, and I haven't tested just yet was to do:</p>
  
  <pre><code>Object someHibernateEntityClass = session.get("MyHibernateEntity", null);
  </code></pre>
  
  <p>If this is the correct way, that's great, if this is not the way, then can you recommend the best way to do it.   Thanks!</p>