Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:15:18+00:00 2026-06-08T02:15:18+00:00

I have a class annotated like this: @Entity @Table(name=MYENTITY) @SequenceGenerator(name=CODE_GEN, sequenceName=SEQ_NAME) public class MyEntity

  • 0

I have a class annotated like this:

@Entity
@Table(name="MYENTITY")
@SequenceGenerator(name="CODE_GEN", sequenceName="SEQ_NAME")
public class MyEntity {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO, generator="CODE_GEN")    
    @Column(name="CODE", nullable=false)
    private int code;

I’m using hibernate 3.6.10 and Oracle10gDialect. The database is Oracle 10g. A sequence was created:

CREATE SEQUENCE SCHEMA_NAME.SEQ_NAME
  START WITH 0
  MAXVALUE 999999999999999999999999999
  MINVALUE 0
  NOCYCLE
  NOCACHE
  NOORDER;
COMMIT;

When I try to persist a MyEntity class, I get:

Hibernate: select hibernate_sequence.nextval from dual
19-jul-2012 13:31:24 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 2289, SQLState: 42000
19-jul-2012 13:31:24 org.hibernate.util.JDBCExceptionReporter logExceptions
GRAVE: ORA-02289: sequence not exist

Why is hibernate always trying to access hibernate_sequence if I’m declaring the sequence name with @SequenceGenerator (sequenceName=”SEQ_NAME”)? Is there something wrong in my annotations?

I have tried lots of combinations and Hibernate always ignores the sequence name and looks for “hibernate_sequence”. BTW I’m using GenerationType.AUTO because this app must also runs vs SQLServer.

Thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:15:20+00:00Added an answer on June 8, 2026 at 2:15 am

    I finally was able to use my own sequences using hibernate’s own annotation, as it seems that this version doesn’t completely support the annotation @SequenceGenerator. So the code ended up like this:

    @Entity
    @Table(name="MYENTITY")
    @GenericGenerator(name="CODE_GEN", strategy = "native", parameters = 
                      { @Parameter(name="sequence", value="SEQ_NAME")})
    public class MyEntity {
        @Id
        @GeneratedValue(strategy=GenerationType.AUTO, generator="CODE_GEN")    
        @Column(name="CODE", nullable=false)
        private int code;
    

    Replacing @SequenceGenerator with @GenericGenerator did the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a domain object annotated like this for hibernate support. @Entity @Table(name =
I have a class this is annotated with @Path like so: @Path(widgets) @Produces(MediaType.APPLICATION_XML) public
I have a similar situation like this one @Entity @Indexed public class Place {
Let's assume I have an annotated bean property setter like this: public class Foo
Let's say I have a domain object that looks like this: @Entity @Indexed public
I have two entity classes annotated in the following way @Entity class A {
I have class with back reference: public class Employee : Entity { private string
Lets say we have this JPA-annotated class, with a property of type List. This
I have a class A that holds a class B like this: class A
Say I have classes Foo and Bar set up like this: class Foo {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.