Integer « Load « JPA Q&A





1. Loading and Saving via Long PK when Mapping says Integer    forum.hibernate.org

3.0.5 This was hard to debug... In the mapping I have a class who's primary key is an Integer. In the code I loaded the class (Status) by giving it a Long. (Obviously this is wrong, but someone used Long by mistake, the class loaded fine) When I would set Status onto Member and session.save(Member) I get the following exception. It ...

2. error session load(java.lang.Class,int) using entity bean    forum.hibernate.org

Hi I'm using ejb 2 and also using hibernate for my entity bean. But I have error when trying to use load() from session instance in my entity bean when I'm compiling it. "symbol : method load(java.lang.Class,int) location: interface org.hibernate.Session Vehicle vhc = (Vehicle) sess.load(Vehicle.class, vehicleid); 1 error" The snippet code as a follow HibernateUtil.beginTransaction(); Session sess = HibernateUtil.getSession(); Vehicle vhc ...

3. Hibernate Load with other argument then integer    forum.hibernate.org

Hi I am use hibernateTemplate.load(User.class, userId) and get the user object but now I want to use this method or any other method in hibernate template for username which is not primary key but unique value in database. like hibernateTemplate.load(User.class, userName) but its not possible and its give me exceptinon that : org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type for class ...