title: Incorrect syntax near the keyword 'table' and could not extract ResultSet
body: <p>I have created a project with SQL Server which the files:</p>
  
  <p>UserDAO.java*</p>
  
  <pre><code>public class UserDAO 
  {
      private static SessionFactory sessionFactory;
      static 
      {
          sessionFactory = HibernateUtility.getSessionFactory();
      }
  
      @SuppressWarnings("unchecked")
      public static List&lt;User&gt; findAll()
      {
          Session session = sessionFactory.openSession();
          Criteria crit = session.createCriteria(User.class);
          List&lt;User&gt; userList = crit.list();
          return userList;
      }
  }
  </code></pre>
  
  <p>UserService.java</p>
  
  <pre><code>public class UserService 
  {
      public static void main(String[] args) 
      {
          List&lt;User&gt; listUsers = UserDAO.findAll();
          for(User u : listUsers)
          {
              System.out.println("User is = " + u.getUserName());
          }
      }
  }
  </code></pre>
  
  <p>hibernate.cfg.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
         &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/property&gt;
         &lt;property name="hibernate.connection.driver_class"&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/property&gt;
         &lt;property name="hibernate.connection.url"&gt;jdbc:sqlserver://localhost:1433;database=happy&lt;/property&gt;
         &lt;property name="hibernate.connection.username"&gt;lm&lt;/property&gt;
         &lt;property name="hibernate.connection.password"&gt;pp&lt;/property&gt;
         &lt;property name="hibernate.hbm2ddl.auto"&gt;create&lt;/property&gt;
         &lt;property name="show_sql"&gt;true&lt;/property&gt;
         &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;
         &lt;property name="hibernate.hbm2ddl.auto"&gt;validate&lt;/property&gt;
         &lt;mapping class="com.annotation.day1.entity.User"/&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>After running the project, the exception bellow displayed:</p>
  
  <pre><code>Hibernate: 
      select
          this_.id as id1_0_0_,
          this_.password as password2_0_0_,
          this_.userName as userName3_0_0_ 
      from
          User this_
  Aug 07, 2016 9:29:00 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
  WARN: SQL Error: 156, SQLState: S0001
  Aug 07, 2016 9:29:00 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
  ERROR: Incorrect syntax near the keyword 'User'.
  Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:89)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:2065)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1862)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
      at org.hibernate.loader.Loader.doQuery(Loader.java:909)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
      at org.hibernate.loader.Loader.doList(Loader.java:2553)
      at org.hibernate.loader.Loader.doList(Loader.java:2539)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
      at org.hibernate.loader.Loader.list(Loader.java:2364)
      at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:126)
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1682)
      at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380)
      at com.annotation.day1.dao.UserDAO.findAll(UserDAO.java:74)
      at com.annotation.day1.service.UserService.main(UserService.java:24)
  Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'User'.
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
  </code></pre>
  
  <p>Any help is appreciated. Thanks in advance.</p>