When we use an embedded in-memory H2 database with Spring Boot, we can access the data via H2’s web console. If we use Spring Security, we need to exclude the /h2-console URL from the authentication process. You also need to
Using Spring Autowired in Kotlin
This post shows an example of how to use @Autowired to inject @Service object in @Controller object Kotlin.
The Number of Entities In a Hibernate Persistence Context
One of my worries with Hibernate was the number of entities accumulating in a Persistence Context. If I were not careful, my codes could potentially store thousands of entities in a Persistence Context. Worse, these objects could stay in memory
Spring Boot Call Stored Procedure With Spring Data @Procedure
Although most applications use SQL statements, we may need to call stored procedures instead. For instance, we could reuse existing stored procedures instead of crafting new codes. As a result, we do not need to create new test cases, and
Using @Query to execute a MySQL function
Using @Query to execute a MySQL function as follows. Here is an example that uses Spring Data @Query to execute a MySQL function that returns a string value. Let’s say we have a MySQL function that returns a predefined text.