@Override public K apply(DBObject dbObject) { return morphia.fromDBObject(datastore, entityType, dbObject, cache); } }, new MorphiaSerializer(morphia));
@Override public K apply(DBObject dbObject) { return morphia.fromDBObject(entityType, dbObject, cache); } }, new MorphiaSerializer(morphia));
/** * Creates an entity and populates its state based on the dbObject given. This method is primarily an internal method. Reliance on * this method may break your application in future releases. * * @param <T> type of the entity * @param datastore the Datastore to use when fetching this reference * @param entityClass type to create * @param dbObject the object state to use * @return the newly created and populated entity */ public <T> T fromDBObject(final Datastore datastore, final Class<T> entityClass, final DBObject dbObject) { return fromDBObject(datastore, entityClass, dbObject, mapper.createEntityCache()); }