Quote:
A Salesman and a Company normally have different characteristics, but should share few and common properties...
This implies to me that you need to introduce an abstract class that contains the common properties to both Company and Salesman (otherwise you are just duplicating code and possibly database entries). So something along the lines of Person <- AbstractSalesThing <- Company and Person <- AbstractSalesThing <- Salesman. This may help somewhat.
However, I'm sure that I am ignoring the true problem at hand, and that may be due to fully understanding your problem. I don't see why you would want to have a Company with the same identification of a Salesman. If I am interpreting your problem, a Salesman should belong to a Company. Then, inheritance should not be used, and rather delegation.
This would appear something like the following:
Code:
public class Salesman extends Person {
private Company company;
public Company getCompany() { return company; }
public void setCompany(Company value) { company = value; }
...
}
If that still does not try to answer your question(s), then please articulate more. As much as I would like to be able to read minds, it's just not possible (at least for me).