I propose a lambda function passed into a configuration option, that given an object o will return the id.