Skip to content

Commit f8cdd6e

Browse files
authored
Update README.md
1 parent a697c42 commit f8cdd6e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Lemick/hibernate-spring-sql-query-count.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Lemick/hibernate-spring-sql-query-count/context:java)
22
# Hibernate SQL Query Assertions for Spring
33

4-
Hibernate is a powerful ORM, but you need to have control over the executed SQL queries to avoid **huge performance problems** (N+1 selects, silent updates, batch insert not working...)
4+
Hibernate is a powerful ORM, but you need to have control over the executed SQL queries to avoid **huge performance problems** (N+1 selects, batch insert not working...)
55

66
You can enable SQL query logging, this is a great help in dev, but not in production. This tool helps you to count the **executed SQL queries by Hibernate in your integration tests**.
77

@@ -41,14 +41,22 @@ The assertion will work seamlessly whether you're testing Spring repositories or
4141
=> '/* insert com.lemick.demo.entity.PostComment */ insert into post_comment (id, blog_post_id, content) values (default, ?, ?)'
4242

4343
## How to integrate
44-
1. Register the integration with Hibernate, you just need to add this key in your configuration (here for yml):
44+
1. Import the dependency
45+
46+
<dependency>
47+
<groupId>com.mickaelb</groupId>
48+
<artifactId>hibernate-query-asserts</artifactId>
49+
<version>1.0.0</version>
50+
</dependency>
51+
52+
2. Register the integration with Hibernate, you just need to add this key in your configuration (here for yml):
4553

4654
spring:
4755
jpa:
4856
properties:
4957
hibernate.session_factory.statement_inspector: com.mickaelb.integration.hibernate.HibernateStatementCountInspector
5058

51-
2. Register the Spring TestListener that will launch the SQL inspection if the annotation is present:
59+
3. Register the Spring TestListener that will launch the SQL inspection if the annotation is present:
5260

5361
* By adding the listener on each of your integration test:
5462

0 commit comments

Comments
 (0)