

java.lang.UnsupportedOperationException at java.base/java.util.InmutableCollections.uoe
Problem: Junit returns next error: Solution: Instead of List.of() or Array.asList() or… you have to use new ArrayList(Arrays.asList(…))...

Enum does not have an accessible constructor
Problem: Mapstruct mapper returns next error: Solution: Maybe there is some data that depends on other mapper, if...

No read accessor found for property in target type
Problem: When you are trying to map nested objects and you are using Mapstruct and Lombok and it...

Two ways to pass parameters to @query in JPA
There are two ways to pass parameters to @query in JPA. First way, using indexed Parameters Second way,...

Update multiple fields with JPA query
To update multiple fields in DB with JPA you have to use @Modifying and @Query. Here, an example:...

JPA: Could not resolve target entity
Problem: When you are trying to use @Query and returns next error: Solution: You have to use as...

JUnit: java.lang.NullPointerException: Cannot invoke “[Ljava.lang.Class;.clone()” because ” .parameterTypes” is null
Problem: If you are launching JUnit test and returns next error: Solution: The problem is that you are...

JPA: jakarta.persistence.TransactionRequiredException: Executing an update/delete query org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation
Problem: When you are using JPA and returns next error: Solution: Just add @Transactional at class level of...