JAVA PERSISTENCE API / NOTES</>↗Java Persistence API12 Nov 2012
This example show you a simple example of an entity object used for mapping database table into Java object. The entity is a Plain Old Java Object (POJO). The JPA specification doesn’t mandate the class to extends or implements other class or interfaces. A class which going to be persisted in a database must be […]
JAVA PERSISTENCE API / NOTES</>↗Java Persistence API11 Nov 2012
JPA is a Java specification for object-relational mapping (ORM) in Java. JPA provide a way to map Java objects to database tables. This allows programmers to manipulate database information directly using Java objects instead of executing database SQL queries. Developer can choose one of many available JPA specification implementation libraries such as Hibernate, Apache OpenJPA […]
SPRING CORE / NOTES</>↗Spring Core08 Nov 2012
As we know that the simplest value that can be expressed in the Spring EL is a literal value such as number. Furthermore, we can also do math operations using the Spring EL. The spring configuration below show you how can do math operations using the Spring Expression Language. These operations include: Add operation (+) […]
SPRING CORE / NOTES</>↗Spring Core07 Nov 2012
In this example you will learn how to call static method using Spring EL. The T() operator of the Spring EL can be used to call static method. First, create the following class, NumberGenerator. This class has a single property randomNumber and getter / setter method. package org.kodejava.spring.core.el; public class NumberGenerator { private int randomNumber; […]
SPRING CORE / NOTES</>↗Spring Core05 Nov 2012
In this example you will learn how to avoid a null value, which causing a NullPointerException thrown in a Spring EL expression. To avoid this from happening we can use the null-safe accessor, using the ?. operator. We are using the previous example, How do I inject bean’s property using Spring EL? classes, which are […]
CONCURRENCY / NOTES</>↗Concurrency05 Nov 2012
This example demonstrate how to use the PriorityBlockingQueue class. The PriorityBlockingQueue is one implementation of the BlockingQueue interface. It is an unbounded concurrent queue. The object place in this type of queue must implement the java.lang.Comparable interface. The Comparable interface defines how the order priority of the elements inside this queue. For simplicity, in this […]