Posts tagged jpa

Using JPA to persist the Tour de France Java Object Graph to relational database tables

In a recent article – http://technology.amis.nl/blog/12786/building-java-object-graph-with-tour-de-france-results-using-screen-scraping-java-util-parser-and-assorted-facilities – I described how I retrieved the statistics for recent Tour de France editions from the official Tour de France website from my Java program and constructed an Java Object Graph for the data on stages, riders and rankings. In this article, I will show how I have persisted that data, from the Java Objects to Relational Tables in my local Oracle XE database. Note: the fact that this concerns Tour de France data is not really relevant for this story – it is a generic story about how JPA is used to map and persist Java Classes and Objects to a relational database.

The Class diagram for the classes involved looks like this:

Image

The Java program discussed in the previous article retrieves data from the Le Tour De France website and creates an Object Graph according to these object definitions. Note: in comparison with the previous article, I have already applied a few small changes that will help with othe ORM mapping that JPA will do for me. The stage and rider references in Standing as well as the tour references in both Rider and Stage have been added. These will easily result in foreign keys to the table holding the Tour instances from the tables for Riders and Stages for example.

Read the rest of this entry »

Masterclass for Java Developers – Make that Database Work for You! 17th December 2010

Really getting the most out of your database. That would be nice, given wat databases can do (and what you may have paid for them).

Few serious Java Applications are completely devoid of interaction of some kind with a database.

However, most ORM and  Java Persistency frameworks do their utmost to hide the database and all it can do from the Java application and very few Java developers can truly leverage the full capabilities of the database their application works with. For all intents and purposes, the database in many cases is still nothing more than a flat storage cabinet.

On 17th December I will present a Masterclass that demonstrates how Java applications can benefit from the functionality on offer from underlying databases in a way that does not impact the application architecture, introduces breaches of open standards or creates undesirable coupling. Using plain JDBC, JPA frameworks and alternative interaction channels – for example http-based RESTful interaction – this seminar demonstrates through many examples how [Java] applications can become better performing, more elegantly designed and more productively developed as well as more scalable and robust.

Read the rest of this entry »

Report from presentation ‘JPA 2.0 – What’s new’

The Java Specification Request 317 (JSR-317) aka JavaTM Persistence 2.0,  (JPA 2.0) has finally reached the last stage, "Completion of Reference Implementation (RI) and Technology Compatibility Kit (TCK)", before it’s officially released. Therefore last week a KC was given with a presentation of the new functionality and differences compared to JPA 1.0 and some hands-on exercises. Read the rest of this entry »

Rapid development of Rich JSF Web applications on top of EJB/JPA persistence (JSF on Rails – Demo 1)

 

Here you will find the first demo from my Devoxx 2008 presentation. It shows how you can rapidly create a rich web application based on Java Server Faces and EJB/JPA persistency using JDeveloper 11g and the ADF 11g framework. The presentation included below shows the steps one by one to create a rich web application. The JDeveloper 11g application can be downloaded as well. The end result looks something like:

it includes such features as: master detail tables with synchronization; column sort; run time column manipulation: resize, reposition and hide/show; popup with detailed context data; data driven, synchronized chart; accordion for better page real estate usage.

Read the rest of this entry »

EJB Dependency Injection of Session Bean Facade in JSF 1.2 on WebLogic 10.3 (JSF with JPA)

 

As I was preparing for my Devoxx presentation next Monday, I decided to look at the somewhat harder way of integrating a JPA based business tier into a JavaServer Faces web tier. The easy way – when using the ADF 11g framework in JDeveloper 11g is creating a Data Control for the Session Facade Bean. The Web Application can create data bindings for entities, entity collections and operations exposed in the Session Facade Bean that completely hide the injection or lookup details from the web tier developer. It’s the ADF responsibility to find the session bean and manage references to it.

However, if you do not use ADF, you need to establish the link between the Web Application and the JPA Business Service yourself.

The JEE 5 way of achieving this consists of a few simple steps – on top of the JPA entity definitions: Read the rest of this entry »

TopLink 11g is available for download

I just found that at OTN’s TopLink page the announcement is already published that was expected later today: TopLink 11g is available. Note that TopLink 11g is based on EclipseLink – an open source product under the Eclipse Foundation. All functionality of TopLink 11g is available in the open source product.

Among the many new features in this 11g release, a few stand out: .... Read the rest of this entry »