Exception while retrieving object in Hibernate

Hi Sir,

I am using generator type = Sequence in my pojo class.

But sir, now there is a problem in retrieving the object from database. It is returning id(primary key) = some negative value and showing following error:

Would you please help me resolving this…?
Screenshot%20(24)
(note : I am using Oracle Database…)

Go to the Oracle SQL console and run the following query:

SELECT last_number
  FROM user_sequences
 WHERE sequence_name = 'ID_SEQ';

If you get a negative value, then it’s because of how you created the ID_SEQ sequence.

To have positive values, create the sequence by specifying the START WITH directive:

CREATE SEQUENCE ID_SEQ START WITH 1 INCREMENT BY 1;

No Sir,
It is returning positive value i mean correct value…

Maybe you have inserted more than 40 Employee rows already and now the sequence returns positive values.

To be sure, log all JDBC statements using datasource-proxy, as explained in this article.