The
recently studied the pros and cons of using MongoDB in projects, and has been thinking, as NoSQL's classic MongoDB, can not in a project completely replace the outstanding representative of the mature relational database MySQL, as the data storage media; It takes a combination of the two to play their greatest power.
Spring's integration with the ORM framework of various relational databases (such as Hibernate/mybatis) is very mature and is the most common way we use in project development. This article describes how to use SPRING-DATA-MONGODB in spring to simplify access to the MongoDB database. Create a new MAVEN project and introduce a SPRING-DATA-MONGODB dependency package, where I list my project pom.xml files.
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < Modelversion>4.0.0</modelversion> <groupId>com.laizs</groupId> <artifactId> Dubbo-project</artifactid> <version>0.0.1-SNAPSHOT</version> <packaging>pom</ packaging> <name>dubbo-project</name> <modules> <module>dubbo-project-model<
/module> <module>dubbo-project-core</module> <module>dubbo-project-rpc</module> <module>dubbo-project-web</module> </modules> <properties> <org.spring Framework-version>3.2.4.release</org.springframework-version> <
Org.springframework.sercurity-version>3.1.4.release</org.springframework.sercurity-version> <org.hibernate-version>3.6.10.Final</org.hibernate-version> <org.aspectj-version>1.6.10</o Rg.aspectj-version> <org.slf4j-version>1.6.6</org.slf4j-version> <project.build.sourceen Coding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</ Project.reporting.outputencoding>