Maybe instead of this loop the entity could have a method to fetch all the dirty attributes that are in the whitelist?