defentity and entity relations