Hibernate version: Hibernate 3.2.0.ga
Mapping documents: The only part that is relevant is the id field that is being set by a database sequence:
<id name="Id" column="ALLERGY_ID" type="java.lang.Long" unsaved-value="0"> <generator class="sequence"> <param name="sequence">ALLERGIES_SEQ</param> </generator> </id>
Code between sessionFactory.openSession() and session.close(): It's spread across interceptors and POJO code, but it looks something like:
Session session = sessionFactory.getCurrentSession(); session.save(allergy); session.flush();
Exception that occurs: 13:57:51,448 ERROR [BasicPropertyAccessor] IllegalArgumentException in class: org.medicalert.mars.model.Allergy, setter method of property: Id 13:57:51,448 ERROR [BasicPropertyAccessor] expected type: java.lang.Long, actual value: java.lang.Long
Name and version of the database you are using: Oracle10.2.0.1.0
The generated SQL (show_sql=true): Hibernate: select ALLERGIES_SEQ.nextval from dual
Debug level Hibernate log excerpt: INFO
As you can see the id of the class in question is bound to a database sequence that is suppossed to automatically fill it in on insert, but instead it's throwing this error. What really confuses me here is the line expected type: java.lang.Long, actual value: java.lang.Long. If the data type it expected is the data type it found, then what is the problem? Am I looking at a misleading error message here? Any insight would be appreciated. Thanks.
|