public < T > Key < T > refToKey ( final DBRef ref ) { return ref == null ? null : new Key < T > ( ( Class < ? extends T > ) getClassFromCollection ( ref . getCollectionName ( ) ) , ref . getCollectionName ( ) , ref . getId ( ) ) ; }
Converts a DBRef to a Key