title: Get the table name from the model in Hibernate
body: <p>How do I get the table name for a model in Hibernate?</p>
  
  <p>Apparently there used to be a <code>getTableName()</code> method in <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/metadata/ClassMetadata.html" rel="noreferrer"><code>ClassMetadata</code></a>, but it's been removed.</p>
  
  <p>There's a <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/Configuration.html#getClassMapping(java.lang.String)" rel="noreferrer"><code>getClassMapping(String entityName)</code></a> method in <a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/Configuration.html" rel="noreferrer"><code>Configuration</code></a>, but I don't know how I can (or if I should) use Configuration from within my DAO implementation.</p>
  
  <p>My DAO implementation is a subclass of <a href="https://source.sakaiproject.org/maven2/org/sakaiproject/generic-dao/site/apidocs/org/sakaiproject/genericdao/hibernate/HibernateGeneralGenericDao.html" rel="noreferrer">HibernateGeneralGenericDao</a>.</p>
  
  <p><strong>UPDATE:</strong> It turns out I can do what I'm trying to do without the table name. However, I will keep the question open (and try the answers as they come) for the sake of reference.</p>