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 7850039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:43:19+00:00 2026-06-02T18:43:19+00:00

My ideal situation would be to have a table that, in production (Oracle) has

  • 0

My “ideal” situation would be to have a table that, in production (Oracle) has an oracle trigger generated auto incremented ID. In unit testing, however, I’d like to be able to “just use H2” as my database, and have it auto create the database for me. But then I lose the auto incremented ID. Is it possible to have both through any means? (basically an optional generated ID?)

Thanks for any help.

  • 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-02T18:43:21+00:00Added an answer on June 2, 2026 at 6:43 pm

    Looks like you can specify the sequence name itself and it will be “auto created” as a sequence within h2. I think defining it as auto_increment would work as well, though I’m not sure how that would work when there’s also a trigger assigning it a value from a sequence. I guess my fear is that hibernate’s auto increment somehow isn’t good enough for multi process apps, but it might be.

    http://www.hibernate-training-guide.com/identifiers-generators.html

    https://forums.oracle.com/forums/thread.jspa?threadID=2370530 may also be helpful

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

Sidebar

Related Questions

I have a situation in which the ideal relationship, I believe, would involve Value
I have a situation where I am running in a WCF service that has
I have a situation when there's a table and you can add a new
I have a situation where we want to prevent the update of a table
We have a db dump import script from our production db that we use
I would like to have a stored procedure that will update values in a
Simplified situation: I have a table, let's call it header with, say, a primary
I have a situation where I need to store some data that just won't
I have the following situation (in Rails 3): my table contains financial transactions for
I find myself in a situation that someone else must have got stuck in

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.