Joined: Wed Nov 07, 2012 2:14 am Posts: 1
|
Hi,
While developing a web application using spring and hibernate i am getting the following execption.
java.sql.SQLException: ORA-02289: sequence does not exist
While i am trying to insert the data into a table i am usign sequence to increment the value of request_id.
I am using the following coding for inserting
public class HibernateConfig { public static SessionFactory sessionFactory; public static SessionFactory getSessionFactory() { sessionFactory = new Configuration().configure().buildSessionFactory(); return sessionFactory; } } @Override public void postRequest(RequestInfo requestInfo) { Session session = null; Transaction trans = null; SessionFactory sessionFactory = null; sessionFactory=HibernateConfig.getSessionFactory(); session= sessionFactory.openSession(); trans = session.beginTransaction(); session.save(requestInfo); trans.commit(); session.close(); }
In hibernate mapping i have mentioned like this
<id name="requestId" type="int" column="request_id" > <generator class="sequence"> <param name="sequence">REQUEST_INFO_SEQ</param> </generator> </id>
i am using oracle 11g.
Can any one give me solution for this.
|
|