So, I a have one entity Alarm:
Code:
public class Alarm {
@Id
@GeneratedValue
public int getSystemId() {
// normal auto-generated primary key
}
public Client getOwner() {
}
public String alarmId() {
}
}
Each Client will own a set of Alarm, each client want to reference
the alarm with one unique alarmId (however, the set of alarmId for
two diff. client will intersect).
So, in Database, example of possible data is
systemId ownerId alarmId
1 1 ALM000001
2 1 ALM000002
3 2 ALM000001
Is there any good way to handle the 'alarmId' generation?
Is this criteria / req common in other apps?
Thanks in advance!