I think the code mentioned in the above referenced thread might be a downside when using it in a subtype. Please try this:
public partial class DataAccessAdapter
{
public string GetTableName(IEntity2 entity)
{
return this.GetFieldPersistenceInfos(entity)[0].SourceObjectName;
}
}
... at least it works here. If you still have problems please describe your inheritance hierarchy and what are the real tables behind them.
(Edit)
Above code will fail if you use Inheritance per Entity Hierarchy with no additional fields on subtype. You better use something like thing:
return this.GetFieldPersistenceInfo(entity.PrimaryKeyFields[0]).SourceObjectName;