Java, Software Development

The Number of Entities In a Hibernate Persistence Context

One of my worries with Hibernate was the number of entities accumulating in a Persistence Context. If I were not careful, my codes could potentially store thousands of entities in

Read More...

Java, Software Development

File Compression in Java with Apache Commons Compress

Apache Commons Compress can be downloaded from http://commons.apache.org/compress/

Read More...

Java, Software Development

How To Use Java 8 Stream Reduce Example

This post shows how to use Java Stream Reduce with example codes. The idea of the reduce operation is the generation of a single result from a collection of values

Read More...

Java, Software Development

iReport 2.0.0 Page Numbers and Page Count

This post shows how to create a jasper report using iReport that displays page numbers and page count, e.g., 1/10. Moreover, the iReport will show the page numbers and page

Read More...

Java, Software Development

Run Java Applications from Apache Ant and a build file

Back in the day, Apache Ant was king. Nowadays, it is Apache Maven. This post shows how to run a Java application from Ant because using the java compiler alone

Read More...

Java, Software Development

Java – Rename a file Using a File Object Example

To rename a file , use the renameTo method in java.io.File.

Read More...

Java, Software Development

Java – Convert JavaBean Using XMLEncoder and XMLDecoder

This post shows how to use the Java classes XMLEncoder and XMLDecoder to convert JavaBean objects to XML and back. Note that they support the specifications for JavaBeans to make

Read More...

Java, Software Development

Java 8 – Convert Iterator to Stream Using StreamSupport

Although not a common scenario, some libraries return Iterators instead of Stream or Collection objects. Why? Because they can. If the Java libraries you are using have methods that return

Read More...

Java, Software Development

Avoid NullPointerException with Stream.ofNullable in Java 9

This post demonstrates how to avoid NullPointerException in Java 9 when working with Stream and using the overloaded of metho

Read More...

Java, Software Development

Java – Create class constructor with fields faster in Eclipse

This post shows how to create a Java class constructor with fields faster in Eclipse. Before the advent of smart IDEs, Java developers write out almost all codes as it

Read More...