The same ID must apply to all entities in the hierarchy. The example you gave overrides the ID in a subclass.