title: org.hibernate.hql.ast.QuerySyntaxException
body: <blockquote>
  <pre><code>org.hibernate.hql.ast.QuerySyntaxException:
  </code></pre>
    
    <p>users is not mapped [SELECT email, id
    FROM users WHERE email='dsdd@dds.com'
    AND password='asasas']</p>
  </blockquote>
  
  <pre><code>public ILogin authenticate(Login login) {
          System.out.println(login);
          System.out.println(login.getEmail());
          String query = "SELECT email, id FROM users WHERE email='"
          + login.getEmail() + "' AND password='" + login.getPassword() + "'";
          results = getHibernateTemplate().find(query);
          System.out.println(results);
          return null;
  }
  </code></pre>
  
  <p>I have a Login Bean class... here it follows. </p>
  
  <pre><code>package 
  
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  
  public class Login {
        public Login(){}
          private Long id = null;
          private String email;
          private String password;
  
          public Login(String email, String password)
          {
              this.email = email;
              this.password = password;
          }
  
          @Id
          @GeneratedValue(strategy=GenerationType.AUTO)
          public Long getId() {
              return id;
          }
  
          public void setId(Long id) {
              this.id = id;
          }
  
          public String getPassword() {
              return password;
          }
  
          public void setPassword(String password) {
              this.password = password;
          }
  
          public String getEmail() {
              return email;
          }
  
          public void setEmail(String email) {
              this.email = email;
  
          }
  }
  </code></pre>
  
  <p>My application-context.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans" default-autowire="byName" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;!-- Turn on AspectJ @Configurable support --&gt;
  
  &lt;context:spring-configured /&gt;
  &lt;context:property-placeholder location="classpath*:*.properties" /&gt;
  &lt;context:component-scan base-package="com.intermedix"/&gt;
  &lt;context:annotation-config/&gt;
  
  &lt;!-- Turn on @Autowired, @PostConstruct etc support --&gt;
  &lt;bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt;
  &lt;bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" /&gt;
  
  
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;com.intermedix.domain.Login&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;create&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="myDataSource" 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://127.0.0.1:3306/spring"/&gt;
          &lt;property name="username" value="monty"/&gt;
          &lt;property name="password" value="indian"/&gt;
      &lt;/bean&gt;   
  
      &lt;tx:annotation-driven transaction-manager="txManager"/&gt;
  
      &lt;bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
        &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>