What your tables are suggesting is the Decorator pattern. So you'd wrap an Entity class within your EntityCompany and EntityPerson classes, delegating underlying properties to the inner object.
Personally, I prefer this pattern over subclassing whenever possible anyways.
Code:
public class EntityCompany : Entity
{
private Entity _inner;
public EntityCompany(Entity entity)
{
_inner = entity;
}
public SomeProperty
{
get{return _inner.SomeProperty;
}
}
If you insist on joined-subclass approach then I believe you'll need to implement some identifier to be unique in addition to the key NHibernate uses to subclass across tables.
MIKE[/code]