Giter Club home page Giter Club logo

spring-data-projects's Introduction

Spring Data

简介

SpringData提供了针对数据库(包括SQLNOSQL)的整合方案,对Hibernate JPAJedis等工具的api进行高级的封装,为我们提供简单方便地操作接口。

Spring Data JPA

Spring Data提供了针对数据库(包括SQLNOSQL)的整合方案,对Hibernate JPAJedis等工具的api进行高级的封装,为我们提供简单方便地操作接口。

Spring Data JPASpring Data项目下的一个模块。整合了基于JPA的持久层框架(默认Hibernate JPA),并对API进行了封装,让我们可以更方便地操作数据库。使用过程中基本不需要编写DAO实现类,只要定义好接口就行了。

学习Spring Data JPA主要包括以下内容:

  1. entityManagerFactory、transactionManager的配置
  2. DAO接口的定义:实现Repository子接口
  3. 基于方法命名规则的查询
  4. 基于@Query注解的查询或更新:JPQL和SQL(对应Hibernate的HQL和SQL)
  5. Respository接口的继承体系
  6. CrudRepository的api使用
  7. PagingAndSortingRepository的api使用
  8. JpaSpecificationExecutor的api使用(对应Hibernate的QBC)
  9. 一对一、一对多、多对多、自关联的配置和操作
  10. 自定义Repository的使用

Spring Data Redis

Spring Data RedisSpring Data的项目下的一个模块。整合了jedis,并对API进行了封装,让我们可以更方便地操作redis

学习Spring Data Redis主要包括以下内容:

  1. 单机和集群的配置

  2. 使用RedisTemplate操作分别操作不同的类型数据:stringlistsetsorted sethash.

  3. 使用RedisTemplate操作事务。

项目实现的需求

Spring Data JPA

采用Spring Data JPA针对以下三个实体进行增删改查操作:

  1. 用户:

  2. 角色:和用户是一对多关系

  3. 菜单:和角色是多对多关系,本身自关联

项目路径:
spring-data-jpa-demo

spring-data-jpa-springboot-demo

Spring Data Redis

  1. 使用Spring Data Redis,以json格式存取不同类型数据:stringlistsetsorted sethash

  2. 测试Spring Data Redis的事务管理。

项目路径:
spring-data-redis-demo

spring-data-redis-springboot-demo

项目工程环境

JDK:1.8.0_201

maven:3.6.1

IDE:Spring Tool Suites4 for Eclipse:4.12

Redis:3.2.100(windows版)

Spring Data Redis:2.1.10.RELEASE

Spring Boot:2.1.7.RELEASE

学习使我快乐!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.