Revision 47136
Added by Claudio Atzori almost 7 years ago
modules/dnet-mongo-logging/trunk/src/main/java/eu/dnetlib/common/logging/dao/DnetLoggerMongoDao.java | ||
---|---|---|
3 | 3 |
import java.util.*; |
4 | 4 |
import java.util.Map.Entry; |
5 | 5 |
import java.util.function.Consumer; |
6 |
import javax.annotation.Resource; |
|
6 | 7 |
|
7 | 8 |
import com.google.common.collect.Lists; |
8 | 9 |
import com.google.common.collect.Maps; |
... | ... | |
21 | 22 |
import org.apache.commons.logging.LogFactory; |
22 | 23 |
import org.bson.Document; |
23 | 24 |
import org.bson.conversions.Bson; |
24 |
import org.springframework.beans.factory.annotation.Autowired; |
|
25 | 25 |
|
26 | 26 |
public class DnetLoggerMongoDao implements DnetLoggerDao { |
27 | 27 |
|
28 | 28 |
private static final Log log = LogFactory.getLog(DnetLoggerMongoDao.class); |
29 | 29 |
|
30 |
@Autowired
|
|
30 |
@Resource(name = "loggingMongoDB")
|
|
31 | 31 |
private MongoDatabase db; |
32 | 32 |
|
33 | 33 |
private IndexOptions indexOptions = new IndexOptions().background(true); |
Also available in: Unified diff
injecting bean by id. We have multiple mongoDB instances defined in the spring context