On Java Development

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

Archive for the ‘JPA’ Category

When to close the EntityManager

without comments

Introduction

The post addresses the question of when to close the JPA Entity Manager. The information presented will show that the answer actually depends on many things, ranging from the use of JSE vs JEE, to how the JTA transaction unit is coded.
Read the rest of this entry »

Written by admin

October 14th, 2015 at 1:23 pm

Posted in JPA

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

Describing a Header/Detail Relationship using JPA Annotations With Hibernate

without comments

Introduction

This post shows how to describe a header/detail relationship (HDR) to Hibernate using files that have a composite key and those with identity records.
Read the rest of this entry »

Written by admin

January 30th, 2014 at 2:22 pm

Hibernate and JPA Annotations

without comments

Introduction

Early releases of Hibernate used an XML document to instruct Hibernate how to map the Entity class to its related database file. It is the mechanism used to associate properties of the entity class to the file’s fields and is known as object/relational mapping. These days, annotations are the preferred method, but there are some things developers need to watch for.
Read the rest of this entry »

Written by admin

January 12th, 2014 at 4:07 pm