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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:19:06+00:00 2026-06-17T07:19:06+00:00

I have some simple properties tables that all extend a @MappedSuperclass. Each property table

  • 0

I have some simple properties tables that all extend a @MappedSuperclass.

Each property table needs to have their own unique long sequence starting from 1L. So, the number of records in the table will always equal the primary key value of the last insert.

I want to use the @GeneratedValue annotation however I a not sure which strategy to use that will ensure that each table has its own sequence of primary keys from 1L upwards.

Any advice would be appreciated.

I am using Hibernate as my JPA implementation.

THERE WILL NEVER BE A RECORD REMOVAL FROM ANY TABLES.**

///ADDITIONAL BACKGROUND INFO////////

The problem I am trying to solve is that when I update properties in a table, other distributed elements of the application are informed that they need to update their own state based on the new properties. I wanted to avoid passing the identifier of the new record in the remote calls and rely on a ‘just look at the latest insert’ approach – hence why I am trying to ensure that the row count equates to the ID of the latest record.

  • 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-17T07:19:07+00:00Added an answer on June 17, 2026 at 7:19 am

    I have simply taken the advice a_horse_with_no_name and generated ID’s using Hibernates auto generation strategy – never requiring sequential input or assertions about the ID of an entity based on the number of rows in the table.

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

Sidebar

Related Questions

I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>
I have setup some simple associations in my rails app: resources :properties do resources
I have a simple program. I want to set the path and some properties
So I have a few properties that I'm using in some sample code I'm
I have some simple constraints involving multiplication of reals in z3 that are producing
I have some simple JQuery / Javascript to perform some simple logic for all
I have some simple markup: <table> <tr> <td>Menu Item</td> </tr> </table> <div> <table> <tr>
The thing is that some css properties have different name is javascript, for example
I have a NewsStories tables which I'm left joining with some related tables. Each
I am designing a very simple table that contains a data element's properties. This

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.