Thanks very much for reply.
I tried java.lang.Integer as well with no luck.
I still get typecasting exceptions...
custNum commented out code may look a bit strange, I agree. In my MySQL table `custNum` is the primary key (INT and AUTO increment), while `id` is just a dummy field used to make Hibernate work. The drawback, of course, is that I can't configure Hibernate to recognize custNum as primary key via <id> tags using an Integer type.
As a workaround, I am using `id` as hibernate id and custNum as my primary key. This makes no sense though, and I'd be really happy if I could replace `id` with `custNum`. I'm not sure why I'm running into this issue. I can't seem to find anything similar happening to others.
This is my table definition so far:
Code:
CREATE TABLE `customer` (
`name` varchar(45) default NULL,
`address` varchar(255) default NULL,
`id` varchar(32) NOT NULL,
`custNum` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY USING BTREE (`custNum`),
KEY `index_id` (`id`)
);