Hypersistence Optimizer Review – detect JPA & Hibernate improvements

Recently I got the chance to review Vlad Mihalcea’s Hypersistence Optimizer. It… checks your JPA and Hibernate mappings and provides you tips about how you can optimize your application For evaluating this tool I picked one of the main applications (Spring Boot 2.1 and Java 8) of my current project. With this blog post, I’ll

Read More

CDI Tutorial – Introduction to Contexts and Dependency Injection

Dependency Injection (DI) is one of the central techniques in today’s applications and targets Separation of concerns. Not only makes this testing easier, but you are also not in charge to know how to construct the instance of a requested class. With Java/Jakarta EE we have a specification which (besides other topics) covers this: Contexts

Read More

Pro CDI 2 in Java EE 8 Book Review

When it comes to creating an application with Java (now Jakarta) EE, the first specification you usually get in touch with is CDI (Contexts and Dependency Injection). Starting with this specification, you’ll probably know it for its dependency injection (DI) capabilities: @Inject. Even besides DI, the CDI spec offers a lot more: events, decorators, interceptors,

Read More

JAX-RS Tutorial – Create Jakarta RESTful Web Services

The REST architectural pattern is widely adopted when it comes to creating web services. The term was first introduced by Roy Fielding in his dissertation and describes a way for clients to query and manipulate the resources of a server. With Jakarta RESTful Web Services (JAX-RS), formerly known as Java API for RESTful Web Services,

Read More

JSON-B Tutorial – Convert Java objects from and to JSON

JSON is the current de-facto data format standard for exposing data via APIs. The Java ecosystem offers a bunch of libraries to create JSON from Java objects and vice-versa (GSON, Jackson, etc.). With the release of Java EE 8 and the JSR-367, we now have a standardized approach for this: JSON-B. With the transition of Java

Read More

Guide to writing Java EE applications with Kotlin

The precise and clean style of writing code with Kotlin is tempting as a Java developer. In addition, switching to Kotlin with a Java background is rather simple. But what about using Kotlin for an existing Java EE application or start using it for a new project? Read this blog post to get a first impression

Read More

Intercept method calls using CDI interceptors

If you have cross-cutting concerns for several parts of your application you usually don’t want to copy and paste the code. For Java EE applications the CDI (Context and Dependency Injection) spec contains the concept of interceptors which are defined in the Java Interceptor specification. With these CDI interceptors, you can intercept business method, timeouts

Read More

MicroProfile Rest Client for RESTful communication

In one of my recent blog posts, I presented Spring’s WebClient for RESTful communication. With Java EE we can utilize the JAX-RS Client and WebTarget classes to achieve the same. However, if you add the MicroProfile API to your project, you can make use of the MicroProfile Rest Client specification. This API targets the following

Read More

Deploy Java EE applications to Kubernetes

Kubernetes is currently the de-facto standard for deploying applications in the cloud. Every major cloud provider offers a dedicated Kubernetes service (eg. Google Cloud with GKE, AWS with EKS, etc.) to deploy applications in a Kubernetes cluster. Once your stateless Java EE application (this is important, as your application will run with multiple instances) is

Read More

Send emails with Java EE and JavaMail using Payara

Sending emails to your application’s clients or customers is a common enterprise use case. The emails usually contain invoices, reports, or confirmations for a given business transaction. With Java, we have a mature and robust API for this: The JavaMail API. The API standard has its own website providing official documentation and quickstart examples. It’s part of

Read More