JPA Model testing with Hibernate Statistics
Problem Often we write JPA Entity classes an have to ensure in a larger team that refactoring doesn’t create performance problems or logical errors in the entity model usual problems are: In your test
Problem Often we write JPA Entity classes an have to ensure in a larger team that refactoring doesn’t create performance problems or logical errors in the entity model usual problems are: In your test
Problem Define a pointcut for annotated methods. The most example are based only on @within or @annotation which has the downside that the aspect is added to all methods and the check of the annotation is executed during runtime. Solution Git Repository https://github.com/sterlp/training/tree/master/aspect Links https://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html https://docs.spring.io/spring-framework/docs/5.3.x/reference/html/core.html#aop-pointcuts-designators
Problem Some services don’t have an UI and the OpenAPI/ Swagger UI should be used as default UI of the service. As so the root should be redirected directly to the SwaggerUI. Solution Just add a WebMvc redirect. Swagger Open API dependencies Spring Boot 2.x Ensure you check the current version: Spring Boot 3.x Ensure…
Java 15 https://www.oracle.com/java/technologies/javase/15-relnote-issues.html Records Preview (JEP 384) Example on Github Text Blocks (JEP 378) Example on Github Pattern Matching Type Checks (JEP 375) Example on Github Other Java 15 language changes Nashorn JavaScript Engine removed Java 14 https://www.oracle.com/java/technologies/javase/14-relnote-issues.html Switch Expressions (JEP 361) Helpful NullPointerExceptions (JEP 358) example Java 13 https://www.oracle.com/java/technologies/javase/13-relnote-issues.html Java 12 https://www.oracle.com/java/technologies/javase/12-relnote-issues.html
Jede Funktion macht genau eine Sache Damit wird sichergestellt das dieser eine klare API und Funktion hat und der Nutzer einer Methode nicht überrascht wird, zB indem es zu einem unerwarteten Seiteneffekt führt. Beispiele: „readPersonById“ ändern zudem auch den Status in der DB, weil es den Zugriff protokolliert „formatDate“ vom DateFormatter führt zu einem Fehler,…
Update NPM modules Update NPM
Install on Windows Startup Guide Note: Windows 10 Pro or higher is required for Hyper-V — the install was recommended to be on the C: drive. Auto Install Check that your CPU virtualization is enabled Download minishift and extract it into a folder Add your user to the Hyper-V Administrators Open Command-Line as Admin User…
Problem In some projects we still may need to manually to reconnect to our JMS provider. For what ever reason the framework or the container cannot do the job for us. As so we have to ensure that an once registered JMS listener re-register itself if something bad happens. Note: Check first if your container…
Problem By default, the JSR 303 Bean validation doesn’t work together with Spring Boot Data REST HATEOAS. Even worse we are confronted with 500 errors like In our Solutions Imagin in the description that we have a bean-like this and of course a Spring Data repository: Link to the full source code. Solution 1: custom…
Nowadays everybody talks about cloud and Microservices. The JEE container isn’t that sexy anymore. With microprofile.io the JEE world started to move into the direction of a more lightweight structure. We should also mention docker and friends which changed the way we deploy and run applications now.