Quote:
1. do you define the employeeID as the primary key for at least one table? If not you may consider using a synthetic ID.
I have many entities that will have relationship with employee entity. Therefore I need to decide how to uniquely identify employee. I'm confused what to choose: synthetic ID or company-defined ID. If It is suggested that I use synthetic ID, then I will save company-defined ID as unique property of employee entity and let another entity (of course by default in hibernate) identify employee by its synthetic ID.
The problem is, should I use synthetic ID?
Quote:
2. is it a numeric value or string? you get a (small) performance boost by joining on numeric keys. If you think you may need all the perf (huge tables) you may want to join on numeric fields.
The ID is alphanumeric (e.g. 40188200687X). Other entities are not aware of how the ID is formed. They only care how to uniquely call an entity of employee (just like common use of relationship in hibernate).
Quote:
3. if an employee's status changes (last name change, move to a diff location) do you have data that needs to stay associated with the old record?
Yup, But in the case of the employee hasn't had any relationship to other entities yet, I can delete the object. If it has, I may not delete it. Instead I just need to set status of the employee as 'off'.
Quote:
Marius