- This topic has 8 replies, 4 voices, and was last updated 17 years, 6 months ago by
mamatha.vijay.
-
AuthorPosts
-
Andrew ChengParticipantI insert a record to the Oracle table through Hibernate
, however, it come out sequence error.
I have seen the problem posted from others.
My question is that why I need sequence here if I do not define
any sequence in Hibernate definition file. My table have five columns
with VARCHAR, I do not use any sequence.🙁
try
{
session = SessionFactory.currentSession();
session.save(u);
session.flush();
// AC
SessionFactory.closeSession();
}– SQL Error: 2289, SQLState: 42000
– ORA-02289: sequence does not exist– SQL Error: 2289, SQLState: 42000
– ORA-02289: sequence does not exist– Could not save object
java.sql.SQLException: ORA-02289: sequence does not existat oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:831)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2496)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2840)November 2, 2004 at 10:45 pm #218739
Riyad KallaMemberHave a look at this thread, it covers the same problem. Hopefully it will help: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-4523-highlight-ora02289.html
November 3, 2004 at 4:30 pm #218800
Andrew ChengParticipantI know you want me refer that. I saw that before I posted this question.
The case is different
they define sequence in hibernate-mapping, so Hibernate complain about not found. I DO NOT define
sequence in hibernate-mapping. I never need it in the Oracle database. ALL my table columns are VARCHAR. NO Sequence needed.November 3, 2004 at 4:39 pm #218801
Andrew ChengParticipant<hibernate-mapping package=”com.aeris.hibernate”>
<class name=”AersysCspUsers” table=”AERSYS_CSP_USERS”>
<id name=”email” column=”EMAIL” type=”java.lang.String”>
<generator class=”native” />
</id><property name=”password” column=”PASSWORD” type=”java.lang.String” />
<property name=”firstname” column=”FIRSTNAME” type=”java.lang.String” not-null=”true” />
<property name=”lastname” column=”LASTNAME” type=”java.lang.String” not-null=”true” />
<property name=”accountId” column=”ACCOUNT_ID” type=”java.lang.Long” not-null=”true” />
<property name=”aerisRole” column=”AERIS_ROLE” type=”java.lang.String” not-null=”true” />
</class></hibernate-mapping>
November 3, 2004 at 5:56 pm #218807
Riyad KallaMemberThis really is a Hibernate question, I don’t know the intracacies of it so I can’t tell you why it would be trying to use a sequence when accessing Oracle. If you do get a good reply, we only ask that you post the solution back here for others.
November 11, 2004 at 12:32 pm #219354
Andrew ChengParticipantplease close
April 11, 2007 at 4:25 pm #268720
mateo3646MemberI had the same problem, but the point was in my XML configuration Archive of my POJO…
You Should change the generator class to : INCREMENT, if you table’s id is like AUTOINCREMENT.
<!– Key(Pojo) vs Key(Table)–>
<id name=”idPaciente” column=”idpaciente” type=”java.lang.Integer”>
<generator class=”increment”/>
</id>Saludos desde la Cd mas Linda del MUNDO
December 17, 2007 at 2:54 am #279717
mamatha.vijayMemberIf you are using
<generator class=”native”> and oracle as backend
then you should create a sequence called hibernate.sequence in oracle because natve generator takes sequence to generate values.To create a sequence in oracle.
create sequence hibernate.sequence;
commit;Mamatha
December 17, 2007 at 2:56 am #279718
mamatha.vijayMemberooops its
********************
hibernate_sequence
********************
thank You -
AuthorPosts