return collection.getName();
}
@Override
public MongoCollection get() {
final Mapper mapper = getMapper();
MongoCollection mongoCollection = new MongoCollection(
collection.get().getDBCollection(),
new Mapper() {
@Override
public Marshaller getMarshaller() {
return mapper.getMarshaller();
}
@Override
public Unmarshaller getUnmarshaller() {
return mapper.getUnmarshaller();
}
@Override
public ObjectIdUpdater getObjectIdUpdater() {
return new ObjectIdUpdater() {
@Override
public boolean mustGenerateObjectId(Object pojo) {
return mapper.getObjectIdUpdater().mustGenerateObjectId(pojo);
}
@Override
public Object getId(Object pojo) {
return mapper.getObjectIdUpdater().getId(pojo);
}
@Override
public void setObjectId(Object target, ObjectId id) {
mapper.getObjectIdUpdater().setObjectId(target,
new ObjectId(iteratingSequence.next().or(id.toString())));
}
};
}
@Override
public QueryFactory getQueryFactory() {
return mapper.getQueryFactory();
}
});
return mongoCollection;
}