Spring Data MongoDB - Spring Web Services - Parent - SpringSource
Spring Data MongoDB - Spring Web Services - Parent - SpringSource Spring Data MongoDB - Spring Web Services - Parent - SpringSource
please define productname in your docbook file!@Configurationpublic class GeoSpatialAppConfig extends AbstractMongoConfiguration {@Beanpublic Mongo mongo() throws Exception {return new Mongo("localhost");}@Overridepublic String getDatabaseName() {return "database";}@Overridepublic String getMappingBasePackage() {return "com.bigbank.domain";}// the following are optional@Overrideprotected void afterMappingMongoConverterCreation(MappingMongoConverter converter) {Set>();converterList.add(new org.springframework.data.mongodb.test.PersonReadConverter());converterList.add(new org.springframework.data.mongodb.test.PersonWriteConverter());converter.setCustomConverters(converterList);}@Beanpublic LoggingEventListener mappingEventsListener() {return new LoggingEventListener();}}Example 7.1 @Configuration class to configure MongoDB mapping supportAbstractMongoConfiguration requires you to implement methods that define acom.mongodb.Mongo as well as provide a database name. AbstractMongoConfigurationalso has a method you can override named 'getMappingBasePackage'which tells the converter where to scan for classes annotated with the@org.springframework.data.mongodb.core.mapping.Document annotation.You can add additional converters to the converter by overriding the methodafterMappingMongoConverterCreation. Also shown in the above example is aLoggingEventListener which logs MongoMappingEvents that are posted onto Spring'sApplicationContextEvent infrastructure.NoteAbstractMongoConfiguration will create a MongoTemplate instance and registered with thecontainer under the name 'mongoTemplate'.You can also override the method UserCredentials getUserCredentials() to provide theusername and password information to connect to the database.Spring's MongoDB namespace enables you to easily enable mapping functionality in XML1.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentation 79
please define productname in your docbook file!>
- Page 34 and 35: please define productname in your d
- Page 36 and 37: please define productname in your d
- Page 38 and 39: please define productname in your d
- Page 40 and 41: please define productname in your d
- Page 42 and 43: please define productname in your d
- Page 44 and 45: please define productname in your d
- Page 46 and 47: please define productname in your d
- Page 48 and 49: please define productname in your d
- Page 50 and 51: please define productname in your d
- Page 52 and 53: please define productname in your d
- Page 54 and 55: please define productname in your d
- Page 56 and 57: please define productname in your d
- Page 58 and 59: please define productname in your d
- Page 60 and 61: please define productname in your d
- Page 62 and 63: please define productname in your d
- Page 64 and 65: please define productname in your d
- Page 66 and 67: please define productname in your d
- Page 68 and 69: please define productname in your d
- Page 70 and 71: please define productname in your d
- Page 72 and 73: please define productname in your d
- Page 74 and 75: please define productname in your d
- Page 76 and 77: please define productname in your d
- Page 78 and 79: please define productname in your d
- Page 80 and 81: please define productname in your d
- Page 82 and 83: please define productname in your d
- Page 86 and 87: please define productname in your d
- Page 88 and 89: please define productname in your d
- Page 90 and 91: please define productname in your d
- Page 92 and 93: please define productname in your d
- Page 94 and 95: please define productname in your d
- Page 96 and 97: please define productname in your d
- Page 98 and 99: please define productname in your d
- Page 100 and 101: please define productname in your d
- Page 102 and 103: please define productname in your d
- Page 104: please define productname in your d
please define productname in your docbook file!>