Changed the way tenants connect to BaseEntity