Quantcast
Channel: Baeldung
Browsing all 4535 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Many-To-Many Relationship in JPA

1. Introduction In this tutorial, we’ll see multiple ways to deal with many-to-many relationships using JPA. To present the ideas, we’ll use a model of students, courses, and various relationships...

View Article


Image may be NSFW.
Clik here to view.

Convert String to Byte Array and Reverse in Java

1. Introduction We frequently need to convert between String and byte array in Java. In this tutorial, we’ll examine these operations in detail. First, we’ll look at various ways to convert a String...

View Article


Image may be NSFW.
Clik here to view.

Deploy a Spring Boot Application to OpenShift

1. Overview In this tutorial, we’ll show how to deploy an application from our Bootstrap a Simple Application using Spring Boot tutorial to Openshift. As part of this we’ll: Install and configure...

View Article

Image may be NSFW.
Clik here to view.

Java Weekly, Issue 255

Here we go… 1. Spring and Java >> Eleven Hidden Gems In Java 11 [blog.codefx.org] A nice run-down of some cool new Java features, including methods for String, Optional, and Collection. >>...

View Article

Image may be NSFW.
Clik here to view.

Generate a Random Alphanumeric String in Kotlin

1. Overview In this tutorial, we’ll discuss how to generate a random alphanumeric String in Kotlin using three different approaches: Java Random, Kotlin Random, and Apache Commons Lang...

View Article


Image may be NSFW.
Clik here to view.

Introduction to Kafka Connectors

1. Overview Apache Kafka® is a distributed streaming platform. In a previous tutorial, we discussed how to implement Kafka consumers and producers using Spring. In this tutorial, we’ll learn how to...

View Article

Image may be NSFW.
Clik here to view.

Spring @RequestParam Annotation

1. Overview In this quick tutorial, we’ll explore Spring’s @RequestParam annotation. Simply put, we can use @RequestParam to extract query parameters, form parameters and even files from the request....

View Article

Image may be NSFW.
Clik here to view.

Customizing HTTP Endpoints in Spring Data REST

1. Introduction Spring Data REST can remove a lot of boilerplate that’s natural to REST services. In this tutorial, we’ll explore how to customize some of Spring Data REST’s HTTP binding defaults. 2....

View Article


Image may be NSFW.
Clik here to view.

Pad a String with Zeros or Spaces in Java

1. Overview In this short tutorial, we’ll see how to pad a String in Java. We’ll focus mainly on a left pad, meaning that we’ll add the leading spaces or zeros to it until it reaches the desired...

View Article


Image may be NSFW.
Clik here to view.

Adding a Newline Character to a String in Java

1. Overview String formatting and generating text output often comes up during programming. In many cases, there is a need to add a new line to a string to format the output. Let’s discuss how to use...

View Article

Image may be NSFW.
Clik here to view.

Criteria API – An Example of IN Expressions

1. Overview We often come across problems where we need to query entities based on whether a single-valued attribute is a member of a given collection. In this tutorial, we’ll learn how to solve this...

View Article

Image may be NSFW.
Clik here to view.

Guide to ReflectionTestUtils for Unit Testing

1. Introduction ReflectionTestUtils is a part of Spring Test Context framework. It is a collection for reflection-based utility methods used in a unit, and integration testing scenarios to set the...

View Article

Image may be NSFW.
Clik here to view.

Java Compiler Error: “class, interface, or enum expected”

1. Overview In this quick tutorial, we’re going to talk about the Java compiler error “class, interface, or enum expected”. This error is mainly faced by developers who are new to the java world....

View Article


Image may be NSFW.
Clik here to view.

Using Subflows in Spring Integration

1. Overview Spring Integration makes it easy to use some Enterprise Integration Patterns. One of these ways is through its DSL. In this tutorial, we’ll take a look at the DSL’s support for subflows...

View Article

Image may be NSFW.
Clik here to view.

Convert between String and Timestamp

1. Overview Timestamp is one of a few legacy date-time objects in Java. In this tutorial, we’ll see how to parse from a String value to a Timestamp object and how to format a Timestamp object to a...

View Article


Image may be NSFW.
Clik here to view.

Abstract Classes in Java

1. Overview There are many cases when implementing a contract where we want to postpone some parts of the implementation to be completed later. We can easily accomplish this in Java through abstract...

View Article

Image may be NSFW.
Clik here to view.

Fixing the JPA error “java.lang.String cannot be cast to [Ljava.lang.String;”

1. Introduction Of course, we’d never suppose that we can cast a String to a String array in Java: java.lang.String cannot be cast to [Ljava.lang.String; But, this turns out to be a common JPA error....

View Article


Image may be NSFW.
Clik here to view.

Difference Between @JoinColumn and mappedBy

1. Introduction JPA Relationships can be either unidirectional or bidirectional. It simply means we can model them as an attribute on exactly one of the associated entities or both. Defining the...

View Article

Image may be NSFW.
Clik here to view.

A Guide to the Java Math Class

1. Introduction In this tutorial, we’re going to describe the Math class that provides helpful static methods for performing numeric operations such as exponential, logarithm, etc. 2. Basic Math...

View Article

Image may be NSFW.
Clik here to view.

Remove or Replace part of a String in Java

1. Overview In this tutorial, we’re going to be looking at various means we can remove or replace part of a String in Java. We’ll explore removing and/or replacing a substring using a String API, then...

View Article
Browsing all 4535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>