Tuesday Jun 10, 2014

Type Conversion in JPA 2.1

The Java Persistence 2.1 specification (JSR 338) adds support for various new features such as schema generation, stored procedure invocation, use of entity graphs in queries and find operations, unsynchronized persistence contexts, injection into entity listener classes, etc.

JPA 2.1 also add support for Type Conversion methods, sometime called Type Converter. This new facility let developers specify methods to convert between the entity attribute representation and the database representation for attributes of basic types.

For additional details on Type Conversion, you can check the JSR 338 Specification and its corresponding JPA 2.1 Javadocs. In addition, you can also check those 2 articles. The first article ('How to implement a Type Converter') gives a short overview on Type Conversion while the second article ('How to use a JPA Type Converter to encrypt your data') implements a simple use-case (encrypting data) to illustrate Type Conversion. Mission critical applications would probably rely on transparent database encryption facilities provided by the database but that's not the point here, this use-case is easy enough to illustrate JPA 2.1 Type Conversion.

Friday Apr 25, 2014

The JavaOne Java EE Track: Thanks, a Sneak Peek and an Invitation

As you know the JavaOne CFP is now closed. I want to take this opportunity to thank all of those that submitted their thoughtful topics and all those who considered submitting. We had the highest number of JavaOne CFP submissions in the recent few years. This is a testament to your passion for the Java community and it is a great start on the road to keeping JavaOne a true success.

In terms of the Java EE track we now have all the raw material we need to construct a strong selection. In the next few weeks we will be working hard with the review committee to carefully sort through all the submissions we have at hand. You should begin to hear back as to decisions on your submissions around early Summer.

I want to remind you now not to be discouraged if you don't get the response you are hoping for. You should remember that you are competing against some of the best and brightest of Java at a global scale - especially so in the Java EE track. As much as we would like for things to be perfect in the end all of this is also based on all too fallible human judgement applied through a fairly intricate process designed with checks, balances and fairness in mind. If your session does not get accepted this year, you should definitely consider honing your submissions and trying again next year. If you are indeed selected I hope you see it as the testament to your abilities and good fortune it truly is. Either way, I hope you will consider coming to JavaOne to experience the incredible talent, energy and intellect in the air.

Invited Speakers/A Sneak Peek
One of the things we are doing differently for JavaOne this year is that we have a small number of well-deserved invited speakers. Besides helping us put together some early content this is a great way to give credit to some of the folks in the community. The following are the folks we have the honor to invite to the Java EE track this year with a bit of a sneak peak about what they will be talking about (as some of you know we have also invited a small number of folks personally to submit via the normal CFP process in addition to these super stars):

Adam Bien needs little introduction. He has been a key Java EE advocate, author, JCP expert and Java Champion for a long time. His passion for Java EE, knowledge as a consultant and skill as a presenter have few parallels. Adam will be talking about just how lightweight Java EE application design can be and other topics.

David Blevins also needs few introductions. He is an excellent speaker, a long-time JCP expert, Java EE advocate and powerhouse developer behind the highly innovative Apache OpenEJB and TomEE projects. David just recently founded Tomitribe, a company offering commercial support for TomEE. David will be talking about exactly why Java EE is a game changer developers should be enthusiastic about and other topics.

Patrycja Wegrzynowicz is the founder and CTO of her own company, a strong technical mind, a JavaOne veteran and a regular speaker at many conferences worldwide. Just some of her interests include patterns/anti-patterns, security, persistence and performance tuning. Patrycja will be sharing her insight on performance tuning techniques for complex JPA 2.1 domain models and other topics. We anticipate her talk would be interesting and valuable to many of you.

Arun Gupta is the former "GlassFish Guy", prolific Java EE advocate, author and blogger. He now enjoys a well-deserved and coveted role as the head of developer advocacy at Red Hat. A great deal of the current success of the Java EE and GlassFish communities can be attributed to Arun's tireless hard work, boundless energy and infectious enthusiasm. We are very honored to have Arun talk about some lessons learned from real world Java EE 7 deployments and other topics.

Anatole Tresch is a key engineer at Credit Suisse and one of the few brave souls with enough initiative to lead JCP JSRs despite not working for a major technology vendor. We are very proud to invite Anatole to talk about the Java EE configuration effort that he is currently helping launch. He definitely deserves the support of the Java EE community and has much to offer in terms of insight on Java EE and the JCP. We look forward to seeing him at JavaOne.

Keep in mind that JavaOne is now already open for registration. There are definitely some advantages to registering early. JavaOne Content Chair Stephen Chin outlines the reasons in an excellent recent blog post.

I hope to see you all at JavaOne. In the meanwhile as always if you have any questions never hesitate to reach out.

Tuesday Apr 08, 2014

New book: EJB 3 in Action, Second Edition

'EJB3 in Action' is one of the reference books when it comes to this important area of Java EE. The second edition covering EJB 3.2 has just been published.

Over the years, the EJB specification has come a long way and has been greatly simplified but nevertheless EJB is still a large specification to grasp. This book is a great (and up-to-date!) introduction to the EJB Component Model. The book goes beyond just introducing EJBs in details as it also explains technologies related to EJB such as CDI and JPA (the older amongst us will remember that EJB, back in the days, used to also handle persistence). The book has also a full chapter devoted to WebSocket, a new important Java EE 7 technology. The final chapter of the book is devoted to a critical, some time over looked, topics: testing.

This is not a pure theoretical book as it really gives 2 views, it first introduce and explains EJBs but also JPA, CDI, etc. The book then explain how to use EJBs and the other technologies, how to put them in action! All in all, a great book to add to any Java EE 7 bookshelf!

Disclaimer: 'EJB 3 in Action' was co-authored by our own Reza Rahman. But to be honest, I was already praising the first edition of the book when Reza wasn't yet working for Oracle.

Friday Mar 21, 2014

Code PaLOUsa 2014 Trip Report

Code PaLOUsa 2014 took place 24-26 February in Louisville, Kentucky. Code PaLOUsa is a fairly unassuming conference with great quality farther away from the beaten paths. Topics covered included Java, .NET, JavaScript, mobile, methodology and Big Data/NoSQL. On my way to Kentucky, I was able to stop by at the Montgomery County (Maryland) JUG for a Java EE 7 session.

At Code PaLOUsa I delivered a talk on aligning Java EE with NoSQL as well as a talk on the Cargo Tracker Java EE/Domain-Driven Design Blue Prints project (this talk was recorded by InfoQ). More details, including slide decks and code, posted on my personal blog.

Thursday Feb 13, 2014

CodeMash 2014 Trip Report

CodeMash 2014 took place 7-10 January in Sandusky, Ohio. With another sold-out year, CodeMash is quickly becoming one of the largest developer conferences state-side. This year it attracted a decent section of the Java crowd including me (Java EE) and my fellow Oracle colleagues Jim Weaver (JavaFX) and Scott Seighman (Java SE 8). I also stopped by at the nascent Penn State University/Happy Valley JUG in State College, PA - kicking off a highly successful and well-attended very first meetup consisting of a whole day Java EE 7 hand-on workshop!

At CodeMash I delivered talks on Java EE 7 and using NoSQL with Java EE, both of which went well. More details, including the slide deck and code, posted on my personal blog.

Monday Dec 16, 2013

Java EE@Pune JUG

Pune JUG organized a meetup at the Symbiosis Institute of Computer Studies and Research (SICRSR) college campus on December 14th. Led by Harshad Oak (Java Champion and organizer of the IndicThreads conference), Pune JUG is the oldest JUG in India and boasts a vibrant developer community. This month's meetup was focused on the Java EE 7 platform and the ecosystem that is building up around it. The meeting was led by Oracle India's own Vijay Nair. Vijay is a good friend and a lead developer with Oracle's FLEXCUBE development group in India. Among many other things like evangelizing Java EE at local Java user groups and conferences, Vijay contributes heavily to the Cargo Tracker Java EE Blue Prints project in his spare time.

 The event saw an attendance of close to around 100 people with a lot of demos/code and high quality interactions with the audience. Vijay presented no less than three sessions at the meetup:

  • JavaEE.Next(): Java EE 7, 8, and Beyond - This is basically our flagship talk at the moment. The talk briefly covers the evolution of the platform, details the changes in Java EE 7 and invites developers to help shape Java EE 8. The materials for the talk is posted here.
  • Android and iOS Development with Java EE 7 - This was a fairly popular technical session at JavaOne San Francisco 2013 led by me, Ryan Cuprak and Bala Muthuvarathan. The session demonstrates how Java EE 7 acts as an excellent platform for building "headless" back-ends for native mobile applications with REST and WebSocket as the client communication protocols. The materials for the talk is posted here. The code is posted on GitHub.
  • Using NoSQL with JPA, EclipseLink and Java EE - This session explores the current state of the NoSQL landscape and how Java EE can be utilized to access NoSQL solutions such as Oracle NoSQL, MongoDB, Cassandra, etc utilizing JPA style facades or plain CDI. The materials for the talk is posted here. The code is posted on GitHub.

Overall, this was a very positive experience with developers giving two thumbs way up to the Java EE 7 platform!

Tuesday Nov 12, 2013

Java Developer Days India Trip Report

October 21st through October 25th I spoke at Java Developer Days India. This was three separate but identical one-day events in the cities of Pune (October 21st), Chennai (October 24th) and Bangalore (October 25th). For those with some familiarity with India, other than Hyderabad these cities are India's IT powerhouses.

The events were focused on Java EE. I delivered five sessions on Java EE 7, WebSocket, JAX-RS 2, JMS 2 and EclipeLink/NoSQL. The events went extremely well and was packed in all three cities. More details on the sessions and Java Developer Days India, including the slide decks, posted on my personal blog.

Wednesday Oct 09, 2013

Using NoSQL with EclipseLink and JPA?

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center. The momentum is such that despite being seen as a stalwart of relational databases, Oracle too has entered the NoSQL ecosystem with Oracle NoSQL. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them (strictly speaking, JPA as it stands today is not intended to support NoSQL from a purely standards standpoint). Such efforts include one from non other than the team behind the Oracle JPA reference implementation EclipseLink. In a code driven blog post, Huseyin Akdogan demonstrates how to use MongoDB using EclipseLink NoSQL. You are also welcome to check out my own slide deck covering using NoSQL databases in Java EE with or without a JPA flavored API (using just plain CDI):

Interestingly, NoSQL support featured quite prominently in the results of a survey around JCP standards put together by the London Java Community (LJC). It would be interesting to hear your thoughts as well.

Robert Greene, John Bracken and Shaun Smith held both a technical session titled "Building Oracle NoSQL Database Applications with EclipseLink" and a BOF titled "Java Persistence for NoSQL" at JavaOne 2013 on this topic. Stay tuned to Parleys.com for the video recordings of the sessions.

Friday Aug 30, 2013

JPA vs. Hibernate?

Whether to use standard vs. non-standard APIs is always a constructive ongoing tug-of-war (well, most of the time anyway). It seems that the tug-of-war is particularly fierce when it comes to anything open source. That's quite unfortunate as open source and open standards should be ideological brothers-in-arms - but then we all know feuds tend to be the worst amongst blood relatives :-). One facet of this debate that seems pervasive and persistent is whether to use Hibernate's legacy non-standard APIs or standard JPA.

Key Hibernate developer Emmanuel Bernard of Red Hat offers his insights on the matter on an audio interview with TSS (TheServerSide) chief editor Cameron McKenzie (spoiler: it's not an either/or proposition :-)). If the past few years is any indicator, this won't settle the war of words, but at least it might be a good bit of input for those interested....

Enjoy!

Friday Jun 28, 2013

Servlet 3.1, Expression Language 3.0, Bean Validation 1.1, Admin Console Replay: Java EE 7 Launch Webinar Technical Breakouts on YouTube


As stated previously (here, here, here, and here), the On-Demand Replay of Java EE 7 Launch Webinar is already available. You can watch the entire Strategy and Technical Keynote there, and all other Technical Breakout sessions as well.

We are releasing the final set of Technical Breakout sessions on GlassFishVideos YouTube channel as well. In this series, we are releasing Servlet 3.1, Expression Language 3.0, Bean Validation 1.1, and Admin Console.

Here's the Servlet 3.1 session:



Here's the Expression Language 3.0 session:



Here's the Bean Validation 1.1 session:



And finally the Admin Console session:



Enjoy watching all of them together in a consolidated playlist:


And don't forget to download Java EE 7 SDK and try the numerous bundled samples.

Tuesday Jun 25, 2013

JSF 2.2, Interceptors 1.2, and JPA 2.1 Replay: Java EE 7 Launch Webinar Technical Breakouts on YouTube


As stated previously (here, here, and here), the On-Demand Replay of Java EE 7 Launch Webinar is already available. You can watch the entire Strategy and Technical Keynote there, and all other Technical Breakout sessions as well.

We are releasing the next set of Technical Breakout sessions on GlassFishVideos YouTube channel as well. In this series, we are releasing JSF 2.2, Interceptors 1.2, and JPA 2.1.

Here's the JSF 2.2 session:



Here's the Interceptors 1.1 session:



Here's the JPA 2.1 session:



Enjoy watching them over the next few days before we release the next set of videos!

And don't forget to download Java EE 7 SDK and try numerous bundled samples.

Friday May 31, 2013

Java EE@JeeConf 2013

JeeConf 2013 was held in historic Kiev on May 24-25. JeeConf is the most significant Java conference in the Ukraine. The conference attracted a bevy of local and international speakers including Venkat Subramaniam, Yakov Fain, Talip Ozturk, Jacek Laskowski, Mohamed Taman and Sander Mak. Topics included Java SE, NoSQL, cloud, HTML5/JavaScript, Arquillian and of course Java EE.

I delivered two very well attended talks - my talk on Java EE 7 (our flagship talk) and a talk on using NoSQL databases in Java EE. More details on the sessions and JeeConf, including the slide decks and code, posted on my personal blog.

Tuesday Apr 02, 2013

Generic JPA DAO/Repository Implementation

The DAO (aka Repository in Domain-Driven Design parlance) is a pervasive design pattern in server-side applications today. If you have a very large number of DAOs that are fairly homogenous/CRUD based, it can be very useful to have a generic version that you can then subclass as needed. German author and celebrated Java EE advocate Adam Bien actually took the time to create generic JPA based DAO code and generously share it with us all.

I encourage you to take a look and discuss the code, preferably with Adam (or here if you wish). If you are the open source hacker sort, you could even consider giving the code more airtime by adding it to a separate project perhaps under something like Apache DeltaSpike.

Thursday Mar 07, 2013

Java EE@DevNexus 2013

DevNexus 2013 was held in Atlanta on February 18-19. For those unaware, Organized by the Atlanta JUG, DevNexus is the most significant Java conference in the South Eastern US. As usual, DevNexus attracted a bevy of world class speakers including Ben Evans, Neal Ford, David Geary and Venkat Subramaniam.

I delivered two full-house Java EE sessions - one on Java EE 7 (our flagship talk) as well as a session on using NoSQL in Java EE via JPA and CDI. More details on the sessions and DevNexus, including slide decks and code examples, posted on my blog.

Monday Mar 04, 2013

A JPA Facade for Neo4j

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center just yet. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them. Such efforts include EclipseLink NoSQL, Hibernate OGM, EasyCassandra and the like.

Amresh Singh, a core contributor of one such project, Kundera, recently wrote a pretty insightful blog post on creating a JPA facade over the popular graph database Neo4j (Kundera already supports Cassandra, HBase, MongoDB, Redis, etc). It's an interesting read - Amresh talks about the challenges and design decisions behind such an inherently intricate effort.

Incidentally, I recently presented at DevNexus on the topic of using NoSQL in Java EE via JPA and CDI. Stay tuned for that trip report, slide deck and code examples...