long « ID « JPA Q&A





1. HSQLDB Internals: Hibernate and Integer vs Long Ids    stackoverflow.com

I am creating database Entities in my Java application and trying to rationalize between using an Integer or a Long as the class type of the "id" field. I am using ...

2. Using hibernate's session.get() with a long ID    stackoverflow.com

I would like to use IDs of type long for my persisted objects. However, I find that get() method requires a Serializable object as its ID parameter (discussed here). What ...

3. Provided id of the wrong type. Expected: Long got Integer    forum.hibernate.org

Newbie Joined: Wed Mar 11, 2009 7:15 am Posts: 12 I got exception Code: org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.Integer; nested exception is org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.Integer at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:679) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) ...

5. Why use Long id's?    forum.hibernate.org

6. HQL does not differentiate between long id and sourceAuditId    forum.hibernate.org

Dear All, I want your openion if I shall submit this as a bug into JIRA. The problem: I have a persistant class called SourceAudit as described below public class SourceAudit implements Serializable { private long sourceAuditId; PK private Date version; private long id; // a property etc... } the mapping file name is SourceAudit.hbm.xml

7. "Long id" or "long id"    forum.hibernate.org

8. CollectionOfElement containing long ids    forum.hibernate.org