Category: JAVA-EE

How to run WildFly applications with JBang

In this article we will learn how to provision a WildFly Server using the JBang scripting tool. Starting from a basic example using a REST endpoint, we will show how to enable additional features on the application server with the WildFly Glow tooling.

Hibernate 7 Tutorial: Top new features

Hibernate 7 is the latest iteration of one of the most popular Object-Relational Mapping (ORM) frameworks for Java, and it brings a suite of powerful enhancements that make it a must-know tool for modern developers. This tutorial dives into the core features of Hibernate 7, explaining how it builds on its strong foundation to enhance type safety, developer productivity, and persistence layer integration.

Hibernate example using JBang

This tutorial demonstrates how to use Hibernate with JBang to execute a sample program that interacts with a database. JBang allows us to run Java programs directly from a script without the need for a full project setup. This means no Maven or Gradle configuration—just a single file with dependencies declared inline.

Jakarta Data in Action

Managing data is one of the most challenging aspects of building software. The Jakarta API, specifically Jakarta Data, offers a straightforward way for Java developers to handle data access without getting bogged down in the technical details of persistence. Its goal is simple: let you focus on your application’s data model while it takes care of the complexity.

Connecting to Redis from a Jakarta EE application

In this tutorial, we’ll learn how to integrate Redis into a Jakarta EE application using the Lettuce client library. Redis is a powerful in-memory data structure store, often used as a cache, message broker, or database. Lettuce is a popular Java client for Redis, providing both synchronous and asynchronous capabilities. We will use a simple REST service to interact with Redis, demonstrating how to add and retrieve data from a Redis hash.

Dynamic Queries with Criteria API

The Hibernate Criteria API provides a powerful and flexible way to build dynamic queries in a type-safe manner. This tutorial will guide you through creating dynamic queries using the Criteria API with practical examples.

Jakarta EE 10 Application with an Angular Frontend

In this tutorial, we’ll walk through the process of creating a simple Jakarta EE 10 application that exposes a RESTful endpoint to fetch a list of customers. We’ll then build an Angular front end that consumes this endpoint and displays the list of customers in a user-friendly format.

Simplifying migration to Jakarta EE with tools

In this article we will learn some of the available tools or plugins you can use to migrate your legacy Java EE/Jakarta EE 8 applications to the newer Jakarta EE environment. We will also discuss the common challenges that you can solve by using tools rather than performing a manual migration of your projects.

How to create an EJB Startup Service

In this tutorial, we’ll explore how to use the @Startup and @Singleton annotations in Jakarta EE applications. These annotations allow us to initialize components during application startup and ensure that they are available throughout the application’s lifecycle. We’ll cover the basics of each annotation, how to use them together, and provide examples to illustrate their usage.

Web services Handler Chains tutorial

Handler Chains play a crucial role in intercepting and processing incoming and outgoing messages. They offer a flexible way to customize and extend the functionality of web services without modifying the core application logic. In this article, we’ll explore what Handler Chains are, how they work, and demonstrate their implementation with a practical example.

Getting started with Jakarta EE

This article will detail how to get started quickly with Jakarta EE which is the new reference specification for Java Enterprise API. As most of you probably know, the Java EE moved from Oracle to the Eclipse Foundation under the Eclipse Enterprise for Java (EE4J) project. There are already a list of application servers which offer a Jakarta EE compatible implementation such as WildFly. In this tutorial we will learn how to bootstrap a Jakarta EE project.

Getting Started with Jakarta Data API

Jakarta Data API is a powerful specification that simplifies data access across a variety of database types, including relational and NoSQL databases. In this article you will learn how to leverage this programming model which will be part of Jakarta 11 bundle.

Facelets tutorial: Using Templates

What are Facelets ? In short, Facelets is a core component of Jakarta Faces specification and also the preferred presentation technology for building Jakarta Faces technology-based applications. In this sample article we will see a few simple example of this technology.

How to store JSON Data with JPA and Hibernate

Several databases provide varying levels of support for JSON data, including storage, indexing, querying, and manipulation capabilities. In this article we will explore how to insert and fetch JSON Data using Jakarta Persistence API and WildFly.

Working with JSON Arrays using Jakarta JSON API

JSON arrays are a fundamental data structure in JSON, used to store collections of values or objects. Java provides the JsonArray and JsonArrayBuilder classes from the Jakarta JSON API to efficiently create, manipulate, and parse JSON arrays. It also provides methods to parse a JSON Array into a Java Collection. In this tutorial we will see both options with practical examples

Mastering Jakarta JSON API from Java Applications

This tutorial will teach you how to use the Jakarta JSON Processing API from standalone Java applications. At the end of it, you will be able to create simple scripts in Java to manipulate, serialize and deserialize JSON content at scale.

JSON pretty printing in Java

When working with JSON data, readability matters. JSON pretty printing is a technique used to format JSON data in a human-readable manner, making it easier to analyze, debug, and understand. In this tutorial, we’ll explore how to perform JSON pretty printing in Java, leveraging libraries to format JSON for improved readability.

Writing JPA applications using Java Records

In this article, we’ll explore how Java Records, available since Java 16, can be used in the context of JPA Application. We’ll uncover how Java Records, renowned for their simplicity and immutability, complement the flexibility and expressive querying abilities offered by the Criteria API.

How to debug transactions in WildFly

This article will guide you through the configuration of a Logger that enables you to debug the Narayana Transactions running in WildFly. By the end of it, you will be able to inspect the full lifecycle of a JTA transaction.

ERROR

/home/francesco/mastertheboss/simply-static-1-1778700701/java-ee/jsf/how-to-solve-viewexpiredexception-view-could-not-be-restored/index.html

How to set the Boolean default to true in JPA?

Java Persistence API (JPA) is a widely used technology for object-relational mapping in Java applications. While mapping Java objects to database tables, developers often need to set default values for certain attributes, such as boolean fields. In this article, we will explore different approaches to setting default values for boolean fields in JPA entities.

Using Built-in Converters in JSF Applications

In Jakarta Server Faces (JSF) applications, you often need to convert data between its native format and a format suitable for display or input on the user interface. JSF provides built-in converters that can handle various data types, including dates, numbers, and more. In this tutorial, we will show how to use them.

Comparing Jackson vs JSONB

JSON-B and Jackson are both libraries that can be used for parsing and generating JSON data in Java. However, they have some differences in their functionality and usage. This tutorial will discuss them in detail.

How to do a Database dump of H2 DB

Using the H2 Database is a common option when developing application prototypes. Once challenge is that, if you are using it as in-memory embedded H2 database , you cannot access the database from outside the JVM. A simple trick is to create a dump of the database, to check the data in all tables In this tutorial we will learn several ways to do that in a standard JPA application and in a Spring Boot application.

Understanding JPA Entity life cycle

This article discusses the life cycle of Entity objects in JPA Applications. Understanding the different stages that an Entity goes through is crucial for proper understanding of the JPA framework.

How to configure distributed EJB Timers

Do you need to scale your EJB Timers at its bests ? WildFly 27 supports a new mechanism for storing your Timers in a cluster: distributed EJB Timers. In this article we will learn how to configure it in no time.

Jakarta MVC made simple

This article discusses how to get started with Jakarta Model-View-Controller (MVC) to build Web applications using this well-known Web pattern in a Jakarta EE application.

What’s new in Jakarta EE 10

Jakarta EE 10 is the first major release of Jakarta EE since the “jakarta” namespace update. Many of the component specifications are introducing Major or Minor version updates that are going to reflect in the implementation APIs. Let’s learn in this article what is new with Jakarta EE 10.

Jakarta EE 10 is on its way with WildFly 27

WildFly 27 (Alpha) is now available. On the the top features of this releases is the preview support for some of Jakarta EE 10 features plus several product enhancement. This article launches you on a tour of this new release by focusing on fundamentals.