DATAMONGO-880 Error when trying to persist an object containing a DBRef ...

Error when trying to persist an object containing a DBRef which was lazy loaded.

When target is cglib enhanced, we should access the id using the getter method.