Support objects with no ID

Some objects don't have IDs and it doesn't make sense for them to have ids. In my case this is for aggregates that are generated in mysql using `GROUP BY` on the fly - it doesn't make sense for the result of a MySQL group by query to have an ID. Currently without this patch, the recordCache uses the cache key undefined, resulting in an array of objects that all have identical attributes