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

  • Home
  • SEARCH
  • 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 8280373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:39:16+00:00 2026-06-08T09:39:16+00:00

We using MYSQL and Hibernate for our project. JPA is used to persist object

  • 0

We using MYSQL and Hibernate for our project.

JPA is used to persist object in DB.

We have Multiple class with similar code

@Entity
@Table(name = "users")
class Users implement Serializable {
   @Id
   @GeneratedValue(strategy=GenerationType.AUTO)
   private Long id;
    .
    .    
    .
   public Long getId() {
    return id;
   }

   public void setId(Long id) {
    this.id = id;
   }
}

Now we want to give support for oracle too. How should we do it ?
strategy=GenerationType.AUTO is not supported by oracle.

One soln is we can define sequence in each POJO which we do not want to do?

please provide us some input so that we can move ahead.

  • 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-08T09:39:17+00:00Added an answer on June 8, 2026 at 9:39 am

    The AUTO strategy should work on Oracle as well. The difference with MySQL is that it will use a sequence instead of relying on an auto_increment ID.

    You can even control the sequence name per entity if desired: see Hibernate sequence on oracle, @GeneratedValue(strategy = GenerationType.AUTO).

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

Sidebar

Related Questions

Hi I am using hibernate and Mysql. I have a class with a boolean
I have problem in creating tinyint field in MySQL database using Hibernate. I used
We have an application using MySQL on Glassfish using JPA (Hibernate) which is working
I'm using EclipseLink in my J2SE project. I'm using mysql and JPA. I have
I'm using: Hibernate MySQL jBoss I have to create an application that allows user
I have a webservice using Hibernate as DAL - using MySql with InnoDB. Since
I have made an application using Java/Hibernate/MySQL, but whenever I try running it, it
I'm using Hibernate with JPA and MySQL. I got accessing denied. java.sql.SQLException: Access denied
I have a Java app using a MySQL database through hibernate. The database is
I have an application using MySQL as the DB and hibernate and struts. I'm

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.