title: expected type: java.lang.Integer, actual value: java.lang.Integer
body: <p>What am I trying to do ?
  While loading my project I get a weird exception:  </p>
  
  <blockquote>
    <p>rezg.admin.server.objects.common.pojo.EmailLogDetails, setter method of property: id</p>
  </blockquote>
  
  <p>I am to save the object (persist) to the DB, using postgres. Environment is Java 6 , Hibernate 3 in Jboss 4 Environment. The jar contains "EmailLogDetails" is in the Jboss lib folder.</p>
  
  <blockquote>
    <p>expected type: java.lang.Integer, actual value: java.lang.Integer IllegalArgumentException in class:
    rezg.admin.server.objects.common.pojo.EmailLogDetails, setter method
    of property: id </p>
    
    <p>org.hibernate.PropertyAccessException: IllegalArgumentException
    occurred while calling setter of
    rezg.admin.server.objects.common.pojo.EmailLogDetails.Id  at
    org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104)
      at
    org.hibernate.tuple.AbstractEntityTuplizer.setIdentifier(AbstractEntityTuplizer.java:204)
      at
    org.hibernate.persister.entity.AbstractEntityPersister.setIdentifier(AbstractEntityPersister.java:3261)
      at
    org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:157)
      at
    org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114).....</p>
    
    <p>Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class   at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)     at
    org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
      ... 74 more</p>
  </blockquote>
  
  <p>EmailLogDetails:</p>
  
  <pre><code>public class EmailLogDetails  implements java.io.Serializable {
  
  private static final long serialVersionUID = 1L;
  private java.lang.Integer id;
  private String reservationNo;
  private String mailSubject;
  private String fromAddress;
  
  public String getFromAddress() {
      return fromAddress;
  }
  public void setFromAddress(String fromAddress) {
      this.fromAddress = fromAddress;
  }
  public java.lang.Integer getId() {
      return id;
  }
  public void setId(java.lang.Integer id) {
      this.id = id;
  }
  public String getMailSubject() {
      return mailSubject;
  }
  public void setMailSubject(String mailSubject) {
      this.mailSubject = mailSubject;
  }
  public String getMailType() {
      return mailType;
  }
  }
  </code></pre>
  
  <p>XML</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt; 
  &lt;!DOCTYPE hibernate-mapping PUBLIC 
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "../server/default/conf/hibernate-mapping-3.0.dtd"&gt;
  
  &lt;hibernate-mapping auto-import="false" schema="@@portalname@@_admin"&gt;
  &lt;class   name="rezg.admin.server.objects.common.pojo.EmailLogDetails" table="emaillogdetails"&gt;
  
        &lt;id name="Id" column="id" type="java.lang.Integer"&gt;
          &lt;generator class="sequence"&gt;
            &lt;param name="sequence"&gt;@@portalname@@_admin.seq_emaillogdetails&lt;/param&gt;
          &lt;/generator&gt;
      &lt;/id&gt;
  
      &lt;property name="reservationNo"  type="java.lang.String" &gt;
          &lt;column name="reservationno" length="20" not-null="false" sql-type="varchar" /&gt;
      &lt;/property&gt;
  
      &lt;property name="mailSubject"  type="java.lang.String" &gt;
          &lt;column name="mailsubject" length="500" not-null="false" sql-type="varchar" /&gt;
      &lt;/property&gt;
  </code></pre>