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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:33:53+00:00 2026-05-19T05:33:53+00:00

when I use hsqldb with grails, it seems that each domain class gets its

  • 0

when I use hsqldb with grails, it seems that each domain class gets its own counter for the id autoincrement. When I create an object of type a, it gets ID=1. When I then create an object of type b, it gets ID=1. When I then create an object of type a again, it gets ID=2.

That’s the behaviour I expect.

when I use an oracle db it seems that there is only one global counter for all IDs of all domain classes. When I create an object of type a, it gets ID=1. When I then create an object of type b, it gets ID=2. When I then create an object of type a again, it gets ID=3.

How can I change this?

  • 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-05-19T05:33:54+00:00Added an answer on May 19, 2026 at 5:33 am

    Grails is using hibernate and by default hibernate is using only one sequence to generate all ids. If you need one sequence per table you can edit Config.groovy. Add following line:

    grails.gorm.default.mapping = {id generator:'identity'}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal To use a CREATE TYPE statement in HSQLDB 2.0.0 to create a user-defined
I use hsqldb to run my unit tests that need a database access. For
Before anyone comments, I must use HSQLDB RDBMS; it's for university java project. My
Trying to configure tigase to use hsqldb (hsqldb-1.8.0.9-1jpp.2) instead of derby (don't ask why,
Is it possible to setup HSQLDB in a way, so that the files with
I am working on a Java application that will use some Hibernate (annotated by
I use HSQLDB in my application. Now i need to log every single sql
I want to use HSQLDB as an embedded database but am having trouble getting
I want to use a standard deviation projection in a query that Im constructing
I am trying to use DBUnit with plain JDBC and HSQLDB, and can't quite

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.