JAVA PERSISTENCE API / CATATAN</>↗Java Persistence API12 Nov 2012
In this example you are going to learn how to persist or save an entity object to database table using JPA. We are going to create a data access object (DAO) for persisting an Artist entity. We create a class called ArtistDaoImpl with a constructor that accept an EntityManager parameter. We provide a couple methods […]
JAVA PERSISTENCE API / CATATAN</>↗Java Persistence API12 Nov 2012
In this code snippet you will learn how to create JPA EntityManagerFactory. This factory enable you to create the EntityManager which will be used to execute the JPA command to manipulate the database tables. To create the EntityManagerFactory you need to create to persistence.xml file first. The file is where you configure the JPA. This […]
JAVA PERSISTENCE API / CATATAN</>↗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 / CATATAN</>↗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 / CATATAN</>↗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 / CATATAN</>↗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; […]