native « ID « JPA Q&A





1. Hibernate + Postgres + native id = AUTO_INCREMENT sadness?    forum.hibernate.org

Any idea why I am getting the following when I try to run our hibernate app on linux against Postgres 7.4.1? Code: [RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:44,328] INFO - hibernate.database=postgres [RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:44,376] DEBUG - Creating Hibernate configuration from prop resource hibernate_ejb_postgres.properties [RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:45,452] DEBUG - Configured Hibernate configuration [RMI TCP Connection(6)-10.0.0.205] ...

3. native id generation with inicial value    forum.hibernate.org

4. native "id" not being generated..    forum.hibernate.org

I chose the NAtive ID generation in hbm mapping file. The session.save(NewObj) fails with "org.hibernate.exception.ConstraintViolationException: ..." saying Insertion failed due to Null ID. I didn't populate this ID in my code assuming Native system will take care of generating this ID value(of type long in my case) when we insert. Any clues?