title: Hibernate object not mapped exception
body: <p>having some issues with the HQL statement to retrieve all Groups from my database.
  I get the following exception:</p>
  
  <pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: Group is not mapped [from Group]
      at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:93) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:324) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3291) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3180) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:706) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:562) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:299) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:247) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:248) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:105) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:80) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
  </code></pre>
  
  <p>Here's the relevant code:</p>
  
  <pre><code>GroupServiceDaoImpl:
      public List&lt;Group&gt; getGroups() {
          List list = getSessionFactory().getCurrentSession().createQuery("from Group").list();
          return (List&lt;Group&gt;) list;
      }
  </code></pre>
  
  <p>spring-hibernate.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:c="http://www.springframework.org/schema/c"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;!-- Beans Declaration --&gt;
      &lt;bean id="User" class="com.youthministry.domain.User"/&gt;
      &lt;bean id="UserProfile" class="com.youthministry.domain.UserProfile"/&gt;
      &lt;bean id="Event" class="com.youthministry.domain.Event"/&gt;
      &lt;bean id="Group" class="com.youthministry.domain.Group"/&gt;
      &lt;bean id="Role" class="com.youthministry.domain.Role"/&gt;
      &lt;bean id="Location" class="com.youthministry.domain.Location"/&gt;
      &lt;bean id="Image" class="com.youthministry.domain.Image"/&gt;
      &lt;bean id="PageContent" class="com.youthministry.domain.PageContent"/&gt;
      &lt;bean id="TextEntry" class="com.youthministry.domain.TextEntry"/&gt;
  
      &lt;!-- User Service Declaration --&gt;
      &lt;bean id="UserService" class="com.youthministry.service.impl.UserServiceImpl"&gt;
          &lt;property name="userDao" ref="UserDao" /&gt;
      &lt;/bean&gt;
      &lt;bean id="GroupService" class="com.youthministry.service.impl.GroupServiceImpl"&gt;
          &lt;property name="groupDao" ref="GroupDao" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- User DAO Declaration --&gt;
      &lt;bean id="UserDao" class="com.youthministry.dao.impl.UserDaoImpl"&gt;
          &lt;property name="sessionFactory" ref="SessionFactory" /&gt;
      &lt;/bean&gt;
      &lt;bean id="GroupDao" class="com.youthministry.dao.impl.GroupDaoImpl"&gt;
          &lt;property name="sessionFactory" ref="SessionFactory" /&gt;
      &lt;/bean&gt;
      &lt;bean id="EventDao" class="com.youthministry.dao.impl.EventDaoImpl"&gt;
          &lt;property name="sessionFactory" ref="SessionFactory" /&gt;
      &lt;/bean&gt;
      &lt;bean id="PageContentDao" class="com.youthministry.dao.impl.PageContentDaoImpl"&gt;
          &lt;property name="sessionFactory" ref="SessionFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Data Source Declaration --&gt;
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/YouthMinistry"/&gt;
          &lt;property name="username" value="root"/&gt;
          &lt;property name="password" value=""/&gt;
      &lt;/bean&gt;
      &lt;!-- Session Factory Declaration --&gt;
      &lt;bean id="SessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;com.youthministry.domain.Event&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.Group&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.Image&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.Location&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.PageContent&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.Role&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.TextEntry&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.User&lt;/value&gt;
                  &lt;value&gt;com.youthministry.domain.UserProfile&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"
          c:_-ref="dataSource" /&gt;
  
      &lt;!-- Enable the configuration of transactional behavior based on annotations --&gt;
      &lt;tx:annotation-driven transaction-manager="txManager"/&gt;
  
      &lt;!-- Transaction Manager is defined --&gt;
      &lt;bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
         &lt;property name="sessionFactory" ref="SessionFactory"/&gt;
      &lt;/bean&gt;
  
   &lt;/beans&gt;
  </code></pre>
  
  <p>Group:
      package com.youthministry.domain;</p>
  
  <pre><code>import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  
  @Entity(name="GROUP_DETAILS")
  public class Group {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Long groupId;
      private String groupName;
      private String groupDesc;
  
      public Long getGroupId() {
          return groupId;
      }
      public void setGroupId(Long groupId) {
          this.groupId = groupId;
      }
      public String getGroupName() {
          return groupName;
      }
      public void setGroupName(String groupName) {
          this.groupName = groupName;
      }
      public String getGroupDesc() {
          return groupDesc;
      }
      public void setGroupDesc(String groupDesc) {
          this.groupDesc = groupDesc;
      }
  
  }
  </code></pre>
  
  <p>Just in case here is the git repo for this project:
  <a href="http://github.com/dmcquillan314/YouthMinistryHibernate" rel="nofollow">http://github.com/dmcquillan314/YouthMinistryHibernate</a></p>
  
  <p>Let me know if any other information about this error is needed and I'll edit the post.</p>
  
  <p>Any ideas are greatly appreciated.  Thanks in advance.</p>