Java EE 5 - Taking a few more steps

· JavaIDEs

I've followed this post's steps to creating persistent data units. This is a new feature in EJB 3.0, following JSR 220. The neat thing with persistent units is that your ORM can be anything supporting the persistence API, be it Toplink, Hibername or whatnot. The other neat thing is removing the neccessity to write complex code for achieving a simple goal as retrieving a selection of an entity bean. In your code, you define a @PestistenceContext EntityManager em field, and you let the Java EE 5 framework do all the dirty business for you. Then, you can invoke EJB-QLs on that entity manager and retrieve entity beans. What the tutorial didn't show is how to define the EJB-QLs outside the code scope, so they could be reconfigured later, but that's reasonable as it was all about simplicity of code.

Nice additions in NetBeans.next

There are a lot of nice additions. These are the ones I found worth mentioning, though.
  • SQL editor An editor with which you could write SQL statements and execute them on your database connection. It supports highlighting, and is a relief from running sql commands straight from the console every time.
  • Configuration graphical editors It's not new in the IDE world, but it's always a pleasure to see. Who needs to hand-write XML? The better the graphical configuration editors, the happier the programmer.
  • Adding frameworks When you add a framework such as JSF or Struts, NetBeans will take care of adding all the configurations for you. It will deal with web.xml, add the configurations for Faces, and even another welcome page for Faces with a link to it from the auto-generated JSP welcome page. Can you really ask for more?
  • Code snips When editing JSP/JSFs, you can now drag and drop snips of code to your page. Along with a short wizard for some, this reduces a lot of code writing.

Features like to see before the version comes out

  • SQL Intellisense Complete the table and column names for us. Have some pre-written queries, such as CRUD operations, built into the editor (much like sout for System.out in the NetBeans editor). It should be fairly easy to implement, and would make a lot of coders really happy - Including yours truly.
  • JSP/JSF editor I've seen a really nice editor, a la Visual Studio, in Sun's Java Studio Creator. Though back then, JS Creator was a commercial product, now it's free like a bird, and it would add a lot of value to add that editor to NetBeans.
  • Friendlier exceptions When an exception occurs in the JSP, it could take a lot of digging before actually finding out what the problem was - Or at least Where it was on the JSP page. Compare this to Tapestry's exceptions (image from here), and you can see what I mean by "friendly".
As some closing lines, I have not successfully finished the tutorial I started with. I think it was my own fault though, so I won't go into a lot of ranting about it now. I will continue my journey in the new Java EE 5 pre-alpha world, and I hope to have some viewable results soon!

Comments (1)

code snips
[...] dog tails, that's what ... some scholars think that the phrase was originally snips of snails. ...Java EE 5 Taking a few more stepsThe other neat thing is removing the neccessity to write complex code for achieving a simple goal as [...]