mongoConfig.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  3. xmlns:p="http://www.springframework.org/schema/p" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
  4. xsi:schemaLocation="
  5. http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/data/mongo
  8. http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context.xsd">
  11. <context:annotation-config />
  12. <mongo:mongo-client id="mongoClient" host="120.77.221.199" />
  13. <mongo:db-factory id="mongoDbFactory" dbname="jtxt-dev" mongo-client-ref="mongoClient" />
  14. <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
  15. <constructor-arg ref="mongoDbFactory" />
  16. </bean>
  17. <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  18. <mongo:repositories base-package="com.jtxt.demo" mongo-template-ref="mongoTemplate" />
  19. <!-- <bean class="com.baeldung.event.CascadeSaveMongoEventListener">-->
  20. <!-- </bean>-->
  21. <!-- <mongo:mapping-converter id="mongoConverter" base-package="com.baeldung.converter">-->
  22. <!-- <mongo:custom-converters base-package="com.baeldung.converter" />-->
  23. <!-- </mongo:mapping-converter>-->
  24. </beans>