Hi ,
I am using HQL to save an object in the DB. It is something like this
Query query = sessionFactory.getCurrentSession().createQuery(ASK_FOR_HELP_SAVE_QUERY);
query.setInteger("status", askForHelp.getStatus());
query.setString("requestId", askForHelp.getRequestId());
query.setString("toAccountId", askForHelp.getToAccountId());
query.setDate("creationDate", askForHelp.getCreationDate());
query.executeUpdate()
;
Now i want the primary key(sequence in DB) of the created object in the DB. I cannot use the select query because no combination of fields will make this object unique in the DB , except the primary key.
I there a way to do this.
Thanks! Pratik