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

How to use Hibernate JPA in a simple Application

This article demonstrates how to use Hibernate Entity Manager 4.3.7 in a simple application.

File Compression in Java with Apache Commons Compress

Apache Commons Compress can be downloaded from

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

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

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

Java 8 – Get my current timezone using ZonedDateTime

This post shows how to get your current timezone in Java using ZonedDateTime class. Get Current Timezone Using ZonedDateTime Since Java 8, it is possible to determine your current timezone

Java – Generate PDF in Specific Version using JasperReports

Some devices can only process specific versions of PDFs. This post shows how to generate specific PDF versions in Java and JasperReports. If our devices are considerably old, chances are

How to update User Country and Language in SAP NetWeaver Portal

We can create SAP NetWeaver Portal users from various sources. One is through LDAP. Unfortunately, the details from LDAP are never comprehensive. Next, is through user inputs. Users register and

Java – Rename a file Using a File Object Example

To rename a file , use the renameTo method in