On Java Development

All things related to Java development, from the perspective of a caveman.

Archive for the ‘Base Project’ Category

JPA Entity Manager Factory, Transaction Manager, Datasource and JNDI Configuration

without comments

Introduction

This post describes the contents of the file “jpaDataSourceContext” found in baseproject. This file contains datasource and JNDI definitions using Spring’s JPA support for Entity Manager Factory, Transaction Manager and Hibernate Adapters. The file is read during the initial phase of the application’s startup processing which occurs when the server is started. This means all data source/JNDI references, used or not, must be present and valid.
Read the rest of this entry »

Written by admin

February 19th, 2015 at 10:52 am

Creating Summary Data using SQL Count(*) and Hibernate

without comments

Introduction

This post shows how to implement a SQL statement with a Count(*) function using Hibernate. This creates a record set that doesn’t map to an existing entity, so the coding needed to pull the data out of the resulting list and to then put them into a container class is a bit different than usual when using Hibernate and mapped entities.

This post also goes beyond being a simple presentation about an SQL statement inside a DAO. Along the way, it explains many Java development concepts that every developer should know. It also exposes forces that should cause the developer to recognize the need for a certain Java Design Pattern.

Maybe this post should have been called “How to Design an Application to use a Mini-Architecture including Services, Business Objects, Data Access and Transfer Objects while using Hibernate to summarize records.“, but the focus is still about how to use the Count(*) function with Hibernate.
Read the rest of this entry »

A ManagedBean Class Template

without comments

Introduction

This post presents what amounts to being an empty Java class designed to act as a starting template for a Managed Bean that is associated with a JSF page. This post highlights the parts that are common to classes of this nature and a few of the not-so-obvious aspects of coding Managed Bean classes.
Read the rest of this entry »

Written by admin

July 2nd, 2014 at 8:55 am

JDBC Connections vs JNDI Connections

without comments

Introduction

This post describe differences between the Java Database Connection API (JDBC) and the Java Naming and Directory Interface (JNDI). These technologies are used to obtain database connections.
Read the rest of this entry »

Written by admin

June 8th, 2014 at 11:16 am

Using Spring to Create Rules

without comments

Introduction

This post shows how Spring can be used to create classes that act as a rule processor or validator. The example presented is very simple but should serve to show the potential for other cases.
Read the rest of this entry »

Written by admin

April 11th, 2014 at 11:09 am

Creating a REST Service with Client

without comments

Introduction

This post shows how to create a REST service using jar-files provided by the JBoss RESTEasy project.
Read the rest of this entry »

Written by admin

April 8th, 2014 at 2:02 pm

Calling RPG or CL Programs with SETLIBLEXEC

without comments

Introduction

This post shows how to call RPG and CL programs using SETLIBLEXEC which is a stored procedure residing on the iSeries (only in QGPL). SETLIBLEXEC accepts parameter values for the environment name of the library list to be used when it runs the name of the program to be called and the parameter values needed by that program.
Read the rest of this entry »

Written by admin

April 3rd, 2014 at 1:42 pm

Using baseproject’s ApplicationContextManager class

without comments

Introduction

This post focuses on the ApplicationContextManager class that comes with baseproject and shows how it is used to obtain the application’s properties from a bean defined to the Spring Context.
Read the rest of this entry »

Written by admin

April 1st, 2014 at 10:13 am

Properly Displaying Messages Using an Error Message Dialog

without comments

Introduction

This post illustrates the use of the error message dialog that is contained in baseproject. It is designed to be displayed when exceptions occur during processing.
Read the rest of this entry »

Written by admin

March 31st, 2014 at 4:57 am

Using the RichFaces Calendar

without comments

Introduction

The calendar component ensures error free entry of dates in a predictable way. This post presents two examples of using the RichFaces calendar component with its dedicated managed bean, included in baseproject.
Read the rest of this entry »

Written by admin

March 27th, 2014 at 10:51 am