org.hibernate.TypeMismatchException when querying the DB
===

I'm working on my first webapp and I'll use hibernate.

I have :

 - Hibernate 3.2.5
 - JSF 2.1
 - Netbeans 7.2 Rc1

What I'm trying to do is, have a form in my webapp where the user will enter their credentials and then I'll match them against what I have in my DB.

First step for that is getting the info though JSF ==> works fine.
Next step is to query the DB to check I have this user and the password is correct.

For this second step I have a problem.

Here is the code I'm calling :

    public String checkUser() {
        /** 1° Query the database for active users with specified name. */
        session = helper.getSessionFactory().openSession();
        PAC_USERS queryUsr = new PAC_USERS();
        session.load(PAC_USERS.class, queryUsr);
        session.beginTransaction();
        queryUsr.setName(this.name);
        this.user = (PAC_USERS) session.get(PAC_USERS.class, queryUsr);
        session.close();
        return null;
        /** 2° verify password against the one stored in the DB. */
    }

here is the hibernate mapping file :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
       <class catalog="pac" name="com.a3c.pac.jsf.beans.PAC_USERS" table="pac_users">
           <id column="id" name="id" type="integer">
               <generator class="identity"/>
           </id>
           <property column="name" name="name" type="string"/>
           <property column="password" name="password" type="string"/>
       </class>
    </hibernate-mapping>
and here is the SQL statement for my table :

    CREATE TABLE `pac_users` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(45) NOT NULL,
      `password` varchar(45) NOT NULL,
      `active` int(11) NOT NULL DEFAULT '1',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1$$
What I want is to query the PAC_USERS table for records with name provided through the web page.

The PAC_USERS.java class might also help, here it is :

    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package com.a3c.pac.jsf.beans;
    
    import java.io.Serializable;
    
    /**
     *
     * @author Utilisateurs
     */
    public class PAC_USERS implements Serializable {
        private Integer id;
        private String name;
        private String password;
        private Boolean active = false;
    
        public Integer getId() {
            return id;
        }
    
        public void setId(Integer id) {
            this.id = id;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String getPassword() {
            return password;
        }
    
        public void setPassword(String password) {
            this.password = password;
        }
    
        public Boolean getActive() {
            return active;
        }
    
        public void setActive(Boolean active) {
            this.active = active;
        }
    }

Any advice would be much appreciated.

Thanks in Advance.

Take care,
Marco.