#generate DB record id in the DB and not in java
9 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @lean fox! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
My questions would be what counts as the DB and what counts as Java.
As far as the DB is concerned, objects don't exist. you call INSERT statements to it. That's it.
Admittedly some while allow to create columns where an id is automatically created when inserting a row in their table, but that doesn't sound much like what's asked.
@ornate rampart Depends, Postgres usually use a sequence to notify the next free number. Oracle 12c can use the new built-in column type identity (https://oracle-base.com/articles/12c/identity-columns-in-oracle-12cr1) what is the most clean solution. The primary-key annotation must differ depending on the database implementation!
......... That doesn't address what I was saying
Yes, sorry, you are right.