I\'m trying to use Hibernate to persist a class that looks like this:
public class Item implements Serializable, Comparable- {
// Item id
private
Further on down the stack trace, it says this:
missing a getter for puchaseDate
You might want to check for typos ;) You're missing an R and setPurchasedate should be setPurchaseDate
Pay attention to method name,It is case sensitive!
In my case,it could not recognize getter very well; my property name was uId
and I used getUId
name for getter name and when I changed it to getuId
problem solved!
I experienced the
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
because I had a momentary lapse of donkeyness when renaming a field on a POJO that I had previously mapped.
I changed the Java attribute name with my trusty IDE refactor hotkey, which does not also change the getter & setter method names. I changed the getter (because it caught my attention with its @Column annotation that I also needed to address because the table column name was changing).
I neglected, however, to change the setter, and that was the cause of the error.
If it can help someone:
In my case there were errors in my mapping files. Classes were not referenced by their full package names. I did this mistake because I generated the mappings when my bean classes belonged to the default package (hence no package name; e.g.: Order
instead of com.mypackage.Order
) and then I moved my bean classes to package (in the example com.mypackage
). Unfortunately mapping files did not changed accordingly with the new package definition.
My hint is redo Hibernate reverse engineering and see what it produces, comparing it with your current mapping files.
It looks like the problem is probably in the capitalization: setPurchasedate()
should be setPurchaseDate()
(with a capital "D").
I included java assit.jar and it worked
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>