getFilesOfEntity: fix of SQL I've broken in 48ddf3