Issue in Adding data into database using hibernate

Posted by sarah on Stack Overflow See other posts from Stack Overflow or by sarah
Published on 2010-04-12T06:50:39Z Indexed on 2010/04/12 6:53 UTC
Read the original article Hit count: 318

Filed under:
|

Hi ,

      I am getting the following exception "org.hibernate.HibernateException: The database returned no natively generated identity value "while adding data into database i am using the following code.Please let me know what is wrong

                    Sesion session=HibernateUtil.getSession();
        Transaction tx =  session.beginTransaction();

        session.save(user);
        logger.info("Successfully data insert in database");
        tx.commit();
        isSaved=true;

Thankx

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate