I want to identify parts we buy at our plant. i require to give every a unique serial number that is based on the date.
We can have multiple parts on a given date so i require to have the unique serial number in the format:
MMDDYYXXX where XXX is a unique number that start with 001 for the 1st item of the day. 002 for the second etc. but starting over the next day.
1. This is a WildFly forum, not JPA or Java.
2. Answer: As you would define any other primary key, no special tricks.