query: moved primary value check from insert & update queries to repository
repository: fixed cached reflection invalidation
find: cached queries should depend on entity changes
tests: added tests for getRelatedFiles() on entity reflection