title: org.hibernate.hql.ast.QuerySyntaxException: Employee_detail is not mapped [from Employee_detail]
body: <p>my sql query is <code>select * from employee_detail;</code></p>
  
  <p>error is:-</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [spring] in context with path [/Roster_APP] threw exception [Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Employee_detail is not mapped [from Employee_detail]] with root cause
  org.hibernate.hql.ast.QuerySyntaxException: Employee_detail is not mapped [from Employee_detail]
  at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
  at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
  at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
  at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
  at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
  at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
  at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
  at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
  at org.hibernate.engine.query.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:77)
  at org.hibernate.engine.query.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:56)
  at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
  at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
  at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
  at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
  at com.lak.dao.impl.EmployeeDaoImpl.getAllEmployee(EmployeeDaoImpl.java:45)
  at com.lak.service.impl.EmployeeServiceImpl.getAllEmployee(EmployeeServiceImpl.java:44)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
  at com.sun.proxy.$Proxy24.getAllEmployee(Unknown Source)
  at com.lak.controller.EmployeeContoller.getAllEmployee(EmployeeContoller.java:44)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>controller is:</p>
  
  <pre><code>@Controller
  public class EmployeeContoller {
  @Autowired
  private EmployeeServices employeeServices;
  
  @RequestMapping("/index")
  public String setupForm(Map&lt;String,Object&gt;map){
  
      Employee employee=new Employee();
      map.put("employee", employee);
      map.put("employee_List", employeeServices.getAllEmployee());
      return "employee";
  
  }
  
  
  
  @RequestMapping(value = "/employeeList", method = RequestMethod.GET)
  public  @ResponseBody ArrayList&lt;Employee&gt; getAllEmployee() {
  
  
  
      System.out.println("-------------- inside getUsers() ...");
  
      ArrayList&lt;Employee&gt; employee_List = (ArrayList&lt;Employee&gt;) employeeServices.getAllEmployee();
  
      return employee_List;
  
  }
  
  
  
  }
  </code></pre>
  
  <p>dao file is:</p>
  
  <pre><code>public interface EmployeeDao {
  public void add(Employee employee);
  public void edit(Employee employee);
  public void delete(String empNumer);
  public Employee getEmployee(String empNumer);
  public List getAllEmployee();
  
  }
  </code></pre>
  
  <p>daoimpl.java is</p>
  
  <pre><code>@Repository
  
  public class EmployeeDaoImpl implements EmployeeDao {
  
      @Autowired
      private SessionFactory session;
  
      @Override
      public void add(Employee employee) {
  
          session.getCurrentSession().save(employee);
  
      }
  
      @Override
      public void edit(Employee employee) {
          session.getCurrentSession().update(employee);
  
      }
  
      @Override
      public void delete(String empNumer) {
          session.getCurrentSession().delete(getEmployee(empNumer));
  
      }
  
      @Override
      public Employee getEmployee(String empNumer) {
          return (Employee)session.getCurrentSession().get(Employee.class, empNumer);
      }
  
      @Override
      public List getAllEmployee() {
          return session.getCurrentSession().createQuery("from employee_detail").list();
      }
  
  
  }
  </code></pre>
  
  <p>hibernate.cfg.xml is :-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; 
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;     
  
       &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
  
          &lt;!-- Assume hibernateTutorial is the database name --&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/roster_app&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.current_session_context_class"&gt; org.springframework.orm.hibernate3.SpringSessionContext
  &lt;/property&gt;
          &lt;property name="connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/property&gt;
          &lt;property name="hibernate.c3p0.idle_test_period"&gt;3600&lt;/property&gt;
          &lt;property name="hibernate.c3p0.timeout"&gt;28800&lt;/property&gt;   
          &lt;mapping class="com.lak.model.Employee" /&gt;
  
      &lt;/session-factory&gt;         
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>how to i solve this problem?</p>