1. What is Springdata.
The Spring Data project is designed to simplify the building of data access counts based on the spring framework application, including non relational databases, Map-reduce frameworks, cloud data services, and so on, and also includes access support for relational databases.
Spring Data contains multiple subprojects:
Commons-Provides a shared infrastructure for use by subprojects to support cross-database persistence
Hadoop-a MapReduce job based on Spring's Hadoop job configuration and a POJO programming model
Key-value-integrates Redis and Riak to provide simple encapsulation in a number of common scenarios
Document-Integrated documentation database: CouchDB and MongoDB and provides basic configuration mapping and database support
Graph-Integrated NEO4J provides a powerful, POJO-based programming model
Graph Roo Addon-roo support for neo4j
JDBC Extensions-Supports Oracle RAD, advanced queues, and advanced data types
JPA-simplifies the creation of JPA data access tiers and persistence layer functionality across storage
Mapping-Provides an object mapping framework based on Grails to support different databases
Examples-sample programs, documents, and diagram databases
Guidance-Advanced Documentation
After seeing so many professional introductions, the spring Data project is designed to provide a common coding model that unifies our APIs.
2.HelloWorld DisplayLearning anything, from a simple and understandable demo to learn, will be very important, the following first to see a simple helloworlddemo directly to the DAO layer.[Java] View plain copy print? <span style= "font-family:comic sans ms;font-size:18px;" >/** * @FileName: personrepotory.java * @Package:com.tgb.springdata.entity * @Description: todo * @author: lucky * @date : November 8, 2015 PM 6:38:58 * @version V1.0 */ package com.tgb.springdata.entity; import java.util.date; import java.util.list; import org.hibernate.type.truefalsetype; import org.springframework.data.jpa.repository.jparepository ; import org.springframework.data.jpa.repository.jpaspecificationexecutor; Import org.springframework.data.jpa.repository.modifying; import org.springframework.data.jpa.repository.query; import org.springframework.data.jpa.repository.support.jparepositoryfactory; import org.springframework.data.repository.crudrepository; import org.springframework.data.repository.pagingandsortingrepository; import org.springframework.data.repository.repository; import org.springframework.data.repository.query.param; /** * @ classname: personrepotory * @Description: todo * @author: lucky * @date: November 8, 2015 afternoon 6:38:58 */ /* * 1.repository is an empty interface, which is a markup interface * 2. If our defined interface inherits repository, the interface is identified by the IOC container as a repository bean * injected into the IOC container, intoIn this interface, you can define interfaces * 3 that meet certain rules. You can actually replace the repository interface */with an annotation @repositorydefination annotation /* * declaring methods in repository sub-interfaces * 1. It's not a statement, it needs to conform to certain specifications