Cheat Sheet: New Features in JPA 2.1

JPA 2.1 introduced 12 new features, like StoreProcedureQueries, Entity Graphs and Attribute Converter, to make your work with the database easier and more efficient.
Download your free New Features in JPA 2.1 cheat sheet now, to get all the information you need to improve your database access.

This 5 page cheat sheet brings you:

- a short description and
- code snippets for each feature,
- links to more detailed articles.

Signup now and get your free New Features in JPA 2.1 cheat sheet and regular blog updates.

I respect your privacy and have ZERO TOLERANCE for spam!

JPA 2.1 Attribute Converter - The better way to persist enums

Persisting enums with JPA 2.0 is possible, but there is no nice way to do it. Using the @Enumerated annotation, you can use EnumType.ORDINAL or EnumType.STRING to map the enum value to its database representation. But both options have their drawbacks. The ordinal of an Enum depends on the ordering of its values and can create problems, if we need to add new ones. The String representation of an Enum is often quite verbose and renaming a value will break the database mapping. These drawbacks can be avoided by using an Attribute Converter.

Criteria Update/Delete - The easy way to implement bulk operations with JPA2.1

With JPA2.1 the Criteria API was extended by CriteriaUpdate and CriteriaDelete. The two classes can be used to implement bulk update and delete operations using the Criteria API.

Links of the Week (CW41) - Wildfly

Hello and welcome to "Links of the week (CW41)" :-)

This week was really busy for me, so there was not so much time to read interesting articles. But that does not mean, that nothing happened. Wildfly 8.0.0.Beta1 was released on the 4th and it became my main topic of the last days. It is the first Wildfly release which implements all user facing EE7 APIs and contains several other improvements like the new high performance web server Undertow. Check the Release Notes and Documentation for more information.

Bear Giles wrote a great article about Database Encryption Using JPA Listeners. He describes a nice and easy way to separate persistence and security by using JPA Listeners.
JPA 2.1 Type Converter are an alternative way to encrypt data before persisting it in the database. A Type Converter can be used to convert an attribute from its entity representation to its database representation and back. If you want to learn more about Type Converters, have a look at the article I wrote on Monday: JPA 2.1 - How to implement a Type Converter

Have fun!

JPA 2.1 - How to implement an Attribute Converter

JPA 2.1 brings several improvements. One of them is the Attribute Converter. It allows the developer to specify methods to convert between the database and the Java representation of an attribute.

Wildfly 8.0.0.Beta1 Released - all major features and user facing EE7 APIs implemented

Wildfly 8.0.0.Beta1

Yesterday, the Wildfly team released Wildfly 8.0.0.Beta1!
The server is available at the Wildfly download page. If you want to read a detailed description of all changes, check the official release notes.

What's new?

Java EE 7 APIs
This is the first Wildfly version which implements all user facing EE7 APIs. This includes updates for JPA, Batch processing, Concurrency, JCA and others.
If you want to try Java EE7 features or have already done that, make sure to use to this version.

Port Reduction
The development team plans to reduce the number of used ports to two with Port 8080 for the application and port 9990 for the management interface. This is done by multiplexing the different protocols over HTTP.
That goal is nearly achieved in this release. Beside the two mentioned ports, Wildfly uses the deprecated native management port 9999. This port will be removed in 8.0.0.Final release.

Management Role Based Access Control (RBAC) and Auditing
Now Wildfly supports RBAC to implement different permissions for the management interface.

The development team resolved 219 issues in this release.

Road Map

Based on the Wildfly JIRA, the road map for Wildfly 8 looks like this:
8.0.0.CR1     11/Nov/13
8.0.0.Final    25/Nov/13


Wildfly download page
Release Notes
Road Map

Links of the Week (CW40) - OpenShift, JavaOne

Hello and welcome to "Links of the week (CW40)" :-)

As every week, I'd like to share the most interesting blog postings and articles I have read.

I read about two main topics during the last days. The first was OpenShift. As you might remember, I posted a link to an interview and howto last week. But I did not stop there and found more interesting links about it.

If you are new to OpenShift but want to use it, you should check the OpenShift Developer Center. The OpenShift Team provide lots of Ressources to learn more about OpenShift and how to use it. This is the point to start if you want to use OpenShift:

And if you want to learn more about the OpenShift architecture, you should read Shane Johnsons article about it:

My second big topic of the last two weeks was (of course) JavaOne2013. I was not able to attend so I tried to get as much content about it as possible.

There were a lot of talks about the keynotes. But to view the VoD is better than to read a summary. So I was happy when Oracle published them as VoDs:

If you want more content about JavaOne you should read Dustin Marks huge Collection of JavaOne2013 related resources. He collected lots of stuff and wrote a Brief summary for each. A must read for everyone who wasn't there.

Have fun!

JBoss Forge - Speedup your enterprise development - Part III Integration Tests with Arquillian

In this third part of the JBoss Forge series, I will show you how to search and install plugins to extend the JBoss Forge functionality. After that we will use Forge to setup Arquillian and create an integration test for our webservice.

If you are new to this series, make sure to check the first two parts.
In the first part, we installed JBoss Tools to get JBoss Forge eclipse integration. Then we created a Java EE project with the entities Book and Author and generated a web interface based on these entities.
In the second part, we created a RESTful webservice API for our entities.