Last Friday I worked through Modifying Database Table Rows with the Java Persistence API. It’s a good tutorial. This has really been my first exposure to the Java Persistence API (Toplink in this case). I’ve had a weekend since I did the tutorial, so I won’t try to say a lot about it. You can read my previous post to get more of my initial thoughts on JPA.
I definitely see JPA as a strong addition to the RAJP’s toolkit. I do not have the instinctive aversion to it that I had to EJB years ago. It’s good stuff. Netbeans works well with it. It generates code and annotations in a very transparent manner (not a given with Netbeans, see Swing GUI Builder). There was a lot of coding in this tutorial, but most of it was on the GUI end.
If we adopted Toplink for our project, it would change a fundamental architectural element. The path to Web Services/SOA/Web 2.0 enlightenment is a mind-expanding process. As my modestly appointed mind slowly and sometimes painfully begins to expand, I’m seeing that I might have 2 mutually exclusive architectural paths to from which to choose: Stored Procedures or Java Persistence. This will most likely be the topic of my next post.
I’d like to expound upon the design elegance the tutorial’s Users and UserController classes and the beauty of JPA in general, but I’ve now lost my patience to do so. I’m sufficiently convinced of the power of JPA and am needing to turn my attention to the process of choosing (if indeed I have to choose) between JPA and Stored Procedures.
Let me just close by saying that if you want a decent feel for how JPA works with Netbeans Visual Web JSF, this tutorial is sufficiently complex for you to get a feel for it. I feel, also that Woodstock would benefit from an addition to their Composite category of widgets: Form (not to be confused with the layout Form). I really liked how easy it was to generate a working form from a Bean with Oracle’s ADF Faces. I did not much relish the process of building and event wiring the form in this tutorial. I don’t change easy, but one thing I’m turning the corner on is the automation of repetitive, low-level application setup. Go ahead Netbeans! Spoil me with automation!