Hi. 
I have tried this namedQuery:
Code:
<query name="Plate.findPlatesByExperiment">
         <![CDATA[select p from Plate p where p.experiment = ? ]]>
</query>
but when I try it I get a IllegalArgumentException on my plate id. I haven't been able to figure this out at all. Some googling have brought me to these two pages:
http://www.developpez.net/forums/archive/index.php/t-145907.htmlhttp://forum.hibernate.org/viewtopic.php?t=964102But since neither my french nor my german is very good I think we need a post of this problem in english as well. 
What does the: 
ERROR BasicPropertyAccessor:167 - IllegalArgumentException in class: net.bioclipse.lis.pojos.AbstractBaseObject, getter method of property: id
mean? I mean I wrote that class and I didn't put any IllegalArgumentException throwing there...
Hibernate version: 3.1.3
Mapping documents:Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping auto-import="true" package="net.bioclipse.lis.pojos">
<!-- AbstractBaseObject -->
   <class
    name="AbstractBaseObject"
    table="ABSTRACTBASEOBJECT">
      
      <meta attribute="sync-DAO">true</meta>
      
      <id
       name="id"
       column="id">
         <generator class="native"/>
      </id>
      <property
       name="name"
       column="name"
       type="string"
       length="100" />
      
      <property
       name="deleted"
       column="deleted"
       type="boolean" />
      
      <many-to-one
       name="creator"
       column="creator"
       class="User" />
      
<!-- AbstractAnnotatableObject -->
      <joined-subclass 
       name="AbstractAnnotatableObject"
       table="ABSTRACTANNOTATABLEOBJECT">
         
         <key column="id" />
         
         
         <set 
          name="abstractAnnotations"
          table="ANNOTATIONANNOTATABLE"
          cascade="all">
            <key column="abstractAnnotatableObject_id" />
            <many-to-many
             class="AbstractAnnotation"
             column="abstractAnnotation_id" />
         </set>      
         
<!-- AbstractAuditableObject -->
         <joined-subclass 
          name="AbstractAuditableObject"
          table="ABSTRACTAUDITABLEOBJECT">
            
            <key column="id" />
            
<!-- Plate -->
            <joined-subclass
             name="Plate"
             table="PLATE">
               
               <key column="id" />
               
               <property
                name="barcode"
                column="barcode"
                type="string"
                length="100"
                unique="true" />
               
               <property
                name="cols"
                column="cols"
                type="integer" />
               
               <property
                name="rows"
                column="rows"
                type="integer" />
               
               <many-to-one 
                name="experiment"
                column="experiment"
                class="Experiment" />
               
               <set 
                name="wells" 
                cascade="all">
                  <key column="wellId"/>
                  <one-to-many class="Well"/>
               </set>
               
               
            </joined-subclass>
            
<!-- PlateLayout -->
            <joined-subclass
             name="PlateLayout"
             table="PLATELAYOUT" >
             
                <key column="id" />
               
               <many-to-one 
                name="plateType"
                column="plateType"
                class="PlateType" />
               
               <set 
                name="layoutWells" 
                cascade="all">
                  <key column="wellId"/>
                  <one-to-many class="LayoutWell"/>
               </set>
               
            </joined-subclass>            
<!-- Project -->
            <joined-subclass
             name="Project"
             table="PROJECT" >
             
                <key column="id" />
               <set 
                name="experiments" 
                cascade="all">
                  <key column="experimentId"/>
                  <one-to-many class="Experiment"/>
               </set>               
            </joined-subclass>            
<!-- Experiment -->
            <joined-subclass
             name="Experiment"
             table="EXPERIMENT" >
             
                <key column="id" />
               
               <many-to-one 
                name="project"
                column="project"
                class="Project" />
               
               <set 
                name="plates" 
                cascade="all">
                  <key column="plateId"/>
                  <one-to-many class="Plate"/>
               </set>   
            </joined-subclass>
                        
         </joined-subclass>
      </joined-subclass>
   </class>
</hibernate-mapping>
Full stack trace of any exception that occurs:org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of net.bioclipse.lis.pojos.AbstractBaseObject.id
	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
	at org.hibernate.tuple.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:176)
	at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3257)
	at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:2983)
	at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:181)
	at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:215)
	at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
	at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:77)
	at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1514)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1576)
	at org.hibernate.loader.Loader.doQuery(Loader.java:661)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
	at org.hibernate.loader.Loader.doList(Loader.java:2145)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
	at org.hibernate.loader.Loader.list(Loader.java:2024)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at net.bioclipse.lis.genericDAO.GenericDAO.executeFinder(GenericDAO.java:57)
	at net.bioclipse.lis.genericDAO.FinderIntroductionInterceptor.invoke(FinderIntroductionInterceptor.java:15)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
	at $Proxy10.findExperimentsByProject(Unknown Source)
	at net.bioclipse.lis.tests.daos.ExperimentDAOTest.testFindExperimentsByProject(ExperimentDAOTest.java:99)
	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 junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1978933
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
	... 43 more
Name and version of the database you are using:mysql  Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (i486) using readline 5.1
The generated SQL (show_sql=true):Debug level Hibernate log excerpt:17:46:47,402 ERROR BasicPropertyAccessor:167 - IllegalArgumentException in class: net.bioclipse.lis.pojos.AbstractBaseObject, getter method of property: id
 Base class with the id field  Code:
package net.bioclipse.lis.pojos;
/**
 * Persistent data storing class.
 * 
 * @author jonathan
 *
 */
public abstract class AbstractBaseObject implements IAbstractBaseObject {
   private Long id;
   private User creator;
   private String name;
   private boolean deleted;
   
   public AbstractBaseObject(){
      
   }
   
   public AbstractBaseObject(User creator, String name) {
      super();
      this.creator = creator;
      this.name = name;
      this.deleted = false;
   }
   
   public void delete(){
      this.deleted = true;
   }
   
   public void unDelete(){
      this.deleted = false;
   }
   
   public void setDeleted(boolean deleted){
      this.deleted = deleted;
   }
   
   public boolean isDeleted(){
      return this.deleted;
   }
   
   public User getCreator() {
      return creator;
   }
   public void setCreator(User creator) {
      this.creator = creator;
   }
   public Long getId() {
      return this.id;
   }
   public void setId(Long id) {
      this.id = id;
   }
   public String getName() {
      return name;
   }
   public void setName(String name) {
      this.name = name;
   }
   /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
       final int PRIME = 31;
       int result = PRIME;
       result = PRIME * result + ((creator == null) ? 0 : creator.hashCode());
       result = PRIME * result + (deleted ? 1231 : 1237);
       result = PRIME * result + ((name == null) ? 0 : name.hashCode());
       return result;
    }
   /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
       if (this == obj)
          return true;
       if ( !(obj instanceof AbstractBaseObject) )
          return false;
       final AbstractBaseObject other = (AbstractBaseObject) obj;
       if (creator == null) {
          if (other.getCreator() != null)
             return false;
       }
       else if (!creator.equals(other.getCreator()))
          return false;
       if (deleted != other.isDeleted())
          return false;
       if (name == null) {
          if (other.getName() != null)
             return false;
       }
       else if (!name.equals(other.getName()))
          return false;
       return true;
    }
}
class which is instantiated:Code:
/**
package net.bioclipse.lis.pojos;
import java.util.Collection;
/**
 * Persistent data storing class.
 * 
 * @author jonathan
 *
 */
public class Plate extends AbstractAuditableObject {
   private int cols;
   private int rows;
   private String barcode;
   private Set wells;
   private Experiment experiment;
   
   public Plate(){
      
   }
   
   public Plate(User creator, Experiment experiment, String name, int cols, int rows, String barcode) {
      super(creator, name);
      this.cols = cols;
      this.rows = rows;
      this.barcode = barcode;
      this.experiment = experiment;
      
      wells = new HashSet<Well>();
      for(char row = 'a' ; row <= 'a'+rows ; row++){
         for(int col = 1; col <= cols ; col++){
            Well well = new  Well(creator, "", col, row, this);
            well.setPlate(this);
            wells.add(well);
         }
      }
   }
   public Set getWells() {
      return this.wells;
   }
   public void setWells(Set wells) {
      this.wells = wells;
   }
   public String getBarcode() {
      return barcode;
   }
   
   public void setBarcode(String barCode) {
      this.barcode = barCode;
   }
   public int getCols() {
      return cols;
   }
   public int getRows() {
      return rows;
   }
   public void setCols(int cols) {
      this.cols = cols;
   }
   public void setRows(int rows) {
      this.rows = rows;
   }
   
   /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
       final int PRIME = 31;
       int result = super.hashCode();
       result = PRIME * result + ((barcode == null) ? 0 : barcode.hashCode());
       result = PRIME * result + cols;
       result = PRIME * result + rows;
       result = PRIME * result + ((wells == null) ? 0 : wells.hashCode());
       return result;
    }
   /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
       if (this == obj)
          return true;
       if (!super.equals(obj))
          return false;
       if (getClass() != obj.getClass())
          return false;
       final Plate other = (Plate) obj;
       if (barcode == null) {
          if (other.getBarcode() != null)
             return false;
       }
       else if (!barcode.equals(other.getBarcode()))
          return false;
       if (cols != other.getCols())
          return false;
       if (rows != other.getRows())
          return false;
       if (wells == null) {
          if (other.getWells() != null)
             return false;
       }
       else if (! (getWells().equals(other.getWells())))
          return false;
       return true;
    }
   public String toString(){
      String result =  "Plate id: " + this.getId() +
                       " Name = "   + this.getName() +
                       " Creator = \n"+ this.getCreator() +
                       " Barcode = " + this.getBarcode() +
                       " Cols = " + this.cols + 
                       " Rows = " + this.rows +
                       " Wells = \n";
      for (Object o : this.wells) {
         Well well = (Well)o;
         result+="\t" + well.toString() + "\n";
      }
      return result;
   }
   
   public Plate deepCopy(){
      return null;
   }
   public Experiment getExperiment() {
       return experiment;
    }
   public void setExperiment(Experiment experiment) {
       this.experiment = experiment;
    }
}