add several useful methods: getKeyName, isDeleted, remove, etc.
add hooks when removing an entity.