-
一篇文章梳理spring boot 加载 spring data jpa的全过程.
用过spring boot 与spring data jpa 的都知道,只需要简单的配置,就能实现数据库的CRUD, 但使用简单的前提是spring 为我们做了太多工作,而这些工作的一个核心就是自动装配,而自动装配也是约定优于配置方案的最佳实践
Date: 2020-11-27 View: 1520
-
给同事做的Spring data JPA培训的教程及例子
项目中用到了 Spring data jpa 这个框架来实现持久层,但 jpa本身来说只是一个标准接口,所以还是用到了Hibernate JPA 的实现。spring data jpa 用起来非常简单,主要从下面四个方面来讲解 Spring data jpa 的使用.1. 入门,使用配置 persistence.xml 文件并结合spring bean 管理 entityManagerFactory 方式测试JPA2. 基于spirng data jpa 实现增删改查3. 基于spring data jpa 实现自定义查询4. 如果spring data jpa 不能完成的sql 采用 自定义扩展类完成。5. 在实际项目中去掉 persistence.xml 文件,完全采用配置 entityManagerFactory 来管理.
Date: 2014-04-10 View: 1520
-
SPRING DATA JPA 中几种缓存的配置
在用spring data jpa的过程中,采用了ehcache 来做缓存, 是否需要二级缓存,一般不需要,这得看业务的需要,因为这东西如果配置不好,反而会导致性能下降,但如果是有些数据,基本不改动,长期不变,很少修改,而且数据量适中,并且外部使用频率高的情况下,还是可以使用的。就目前研究spring data jpa 来说,有三种情况下有可能会使用到缓存1. spring data jpa 自身的方法2. 扩展spring data jpa 的方法3.完全自己用EntityManager 写语句的缓存.
Date: 2013-07-24 View: 1520
-
Java AWT Drawing rectangle, line and circle
The java.awt libraries are set of classes provided by Java in order to draw shapes on a window. The abbreviation AWT stands for Abstract Windowing Toolkit. Today, the library has been converted into a huge set of classes which allows the user to create an entire GUI based application. The visual appearance of these classes depends on the platform on which the application runs.
Date: 2019-08-17 View: 1520
-
JPA optimistic lock exception in Java Development
This post explains the JPA technology and its use in java development. Experts of java development India are explaining the use case of technologies- JPA and Hibernate, MySql database, Maven. Read this post and know what they want to say.
Date: 2019-08-17 View: 1520
-
Spring Boot + Spring Data JPA + Oracle example
In this article, we will show you how to create a Spring Boot + Spring Data JPA + Oracle + HikariCP connection pool example.
Date: 2019-08-11 View: 1520
-
Spring Boot Show Hibernate SQL query
Add the following lines in application.properties to log the Hibernate SQL query.
Date: 2019-08-11 View: 1520
-
JPA Insert + Oracle Sequences example
A quick JPA + Oracle sequences example, for self reference.
Date: 2019-08-11 View: 1520
-
Spring Data Add custom method to Repository
In this article, we will show you how to add a custom method to Spring Data JPA CrudRepository and MongoDB MongoRepository
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring Data JPA + Java 8 date and time (JSR310)
In Spring Boot + Spring Data JPA application, to support the JSR310 java.time.* APIs, we need to register this Jsr310JpaConverters manually.
Date: 2019-08-11 View: 1520
-
Spring REST Hello World Example
In this article, we will show you how to develop a Spring Boot REST style web service to handle CRUD operations from a H2 In-memory database.
Date: 2019-08-11 View: 1520
-
Spring + Mockito Unable to mock save method?
Try to mock a repository save() method, but it is always returning null?
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring data JPA
In this tutorial, we will show you how to use Spring Boot + Spring data JPA to save data into an H2 in-memory database and how to also query the data.
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring data JPA + MySQL
The previous Spring Boot + Spring data JPA will be reused, modify to support MySQL database.
Date: 2019-08-11 View: 1520
-
Spring Boot + Spring data JPA + PostgreSQL
The previous Spring Boot + Spring data JPA will be reused, modify to support PostgreSQL database.
Date: 2019-08-11 View: 1520