Register / Login
JDBC and Relational Databases
Best Way for auto-increment/sequence generation upon a composite-key with 2 columns
posted 1 year ago
I am intermediate to
, please suggest me best Way for developing a logic for auto-increment/sequence generation upon a composite-key with 2 columns.
I want to have Composite Primary Key on two columns like this :
PRIMARY KEY (`base`, `id`);
to be auto-incremented and based on that
be auto-incremented for the same base
The base currently represents a company, the id represents invoice number.
be auto-incrementing invoice numbers for each company but there could be cases where two companies have invoices with the same number.
with Sybase Database.
Is it possible to do it with programming exactly?
Referential Integrity: How 2 INSERT the professional way ?
Best way to generate PK in EJB
Hibernate .hbm.xml - Referential Integrity constraint
ejb3 primary key generation does not work without automatic schema generation
2 primary keys with mysql