I get the following error:
Code:
net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling: argument type mismatch setter of org.mathesis.user.User.userID
net.sf.hibernate.util.ReflectHelper$Setter.set(ReflectHelper.java:65)
net.sf.hibernate.persister.AbstractEntityPersister.setIdentifier(AbstractEntityPersister.java:244)
net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:729)
net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:607)
org.mathesis.test.HibernateTest.createCats(HibernateTest.java:77)
org.mathesis.test.HibernateTest.doGet(HibernateTest.java:52)
after calling this:
Code:
out.print("<h3>Creating Users:</h3>");
out.println("CREATING 'Jan Wandelaar'...<br/>");
User imh = new User();
imh.setEmailAddress("jan@domain.bogus");
imh.setFirstName("Jan");
imh.setLastName("Wandelaar");
imh.setPassword("secret");
imh.setUserName("jw");
session.save(imh);
(the odd thing is that the user IS added, so the error occurs after a user has been added in the database)
The error occurs at:
session.save(imh);mapping:
Code:
<id
name="userID"
column="USERID"
type="long"
>
<generator class="native">
</generator>
</id>
mysql table structure:
Code:
+--------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+----------------+
| USERID | bigint(11) | | PRI | NULL | auto_increment |
| FIRSTNAME | varchar(255) | | | | |
| LASTNAME | varchar(255) | | | | |
| USERNAME | varchar(255) | | | | |
| PASSWORD | varchar(255) | | | | |
| EMAILADDRESS | varchar(255) | | | | |
+--------------+--------------+------+-----+---------+----------------+