Red Hat

In Relation To Max Andersen

In Relation To Max Andersen

New beta releases of JBossTools and Red Hat Developer Studio out!

Posted by    |       |    Tagged as

New beta versions of JBoss Tools and Red Hat Developer Studio got released today.

This is good news for Seam 1.2 users since we now have full support for creating Eclipse WTP compatible projects including Seam 1.2.1 hotdeployment of Seam components. Add in the full incremental in-sync deployment to JBoss AS servers and you got a pretty sweet and fast development environment.

The relase also provides some news for Hibernate Tools users and other additional bug fixes; you can read about them in What's New and Noteworthy

Before you ask, then no Seam 2 is unfortunately not yet supported for the project creation wizards, but the code completion and Seam views will work with Seam 2; just need to right click on the project and click Add Seam support.

...and if you are really into it you can use the Seam 1.2 generated project as a basis for migrating the libraries and configuration files to Seam 2 counter-parts and you will have all the goodies with hotdeployment available too you.

Have fun!

Genuitec switches course part deux

Posted by    |       |    Tagged as

I am glad that Genuitec finally made their changes to Hibernate Tools publicly available at their open source resources page. That is all that I/we ever asked for.

As an added bonus they even included their changes to the EPL based Aptena project. I look forward to see Genuitec keeping their open source page in-sync with any future updates they include in their product.

In his blog, Mr. Masri claims they reached out to me a year ago to do a contribution. He seem to forget that it was I who had to remind them multiple times about the LGPL issue before this happened - the first direct reminder being sent four months earlier before they reached out to me.

I did though receive a contribution from their developers one year ago. I replied back then why a particular feature could not be applied to our main code base (it introduced a dependency to Eclipse API where it should not be). Contributors to open source know that rejection of submitted code is a common thing in open source development.

Since May-2006 none of the changes made to Hibernate Tools in the MyEclipse code base have been made available (before today) even though I and others privately asked for them, in at least two written requests and a couple of private conversations.

I would like to remind Mr. Masri that it is not my (or any others) responsibility to make Genuitec's LGPL changes available in a timely manner, no matter if they have been rejected or accepted by the original project - it is the sole responsibility of Genuitec; it should not be necessary to repeatedly remind Genuitec or any other third party about their responsibilities to make their LGPL'ed code available as the license states.

I do though encourage any LGPL, EPL or other copyleft licensed software authors that notice their software license is not being honored by Genuitec or any other third party to contact them to resolve the issue.

Hopefully they will now react faster and without the need for a public debate.

I hope this now concludes our little saga; and I will do as I have done multiple times before. Namely to encourage anyone (including Genuitec) to put contributions/feature request/bug reports into our JIRA so we all can benefit from it while it happens instead of waiting months/years to do it - but please, do be ready to handle a rejection once in a while.

FYI, a good external summary is available at

Seam meetup and JBoss/Red Hat at EclipseCon

Posted by    |       |    Tagged as Seam

Seam meetup

Tonight most of the Hibernate Team and especially the Seam Team met for the first time in person in San Francisco. The next couple of days we will have fun digging into what is next for Hibernate and Seam in particular.

Since this is such a special occurrence you are all invited to help us celebrate this on Friday, March the 2nd in the evening. The details is to be found at this space .


That is though not the only thing happening around SF; next week there is EclipseCon in Santa Clara where JBoss/Red Hat will have a booth and do the following talks.

Eclipse Linux Distros Project Overview

Autotools demo

OSGi and JBoss Microcontainer

JBoss introduces new open source tools and frameworks for building rich internet applications

Developing an Editor for Directed Graphs with the Eclipse Graphical Editing Framework

Building Rich Internet Applications With Open Source JBoss Frameworks and Tools

and finally, Hibernate Tools

See you there!

Hibernate Tools goes to the movies

Posted by    |       |    Tagged as

Last week we released Hibernate Tools 3.2.0.beta9 and we actually did it twice.

A typo error prevented JPA configurations from working from inside Eclipse thus if you downloaded Hibernate Tools early last week you should go and make sure to get the beta9a version.

Ease of setup

This release has a lot of improvements but the best new feature is definitely that we no longer require users to setup and maintain a separate classpath for the console configuration. Now the classpath of the java project will be used by default.

This makes the setup much easier.

The second best new feature is the full support for JPA configurations (through Hibernate EntityManager). This means that we do also no longer require a hibernate.cfg.xml with a listing of all the annotated classes; the discovery of entities and configuration will be done automatically as long as you have a /META-INF/persistence.xml in your class path.

The last feature I want to mention is again a feature that strips down the need for setup compared to before. HQL editing and validation inside java code is now enabled automatically for projects that has a console configuration associated.

Could it be made easier ? Let us know

Seeing is believing...

To get a feel of the improvements and the overall functionality we created a set of viewlets/movies.

We have done this before and received good feedback on them and most people thought they were informative but too long and boring.

Therefore we made a bunch of small and to the point movies showing the basics of each major/primary feature, allowing you to just see what you are interested in and not get bored too long.

The movies are listed here .

Have fun!

5 years and Hibernate in Copenhagen

Posted by    |       |    Tagged as

I cannot believe it is now 5 years ago I bumped into hibernate, and if you use the way back machine and know the original url(s) of the project you can have a walk down memory lane (yes, the front page were even simpler than what Christian just posted in the very first days of Hibernate; I guess he were being nice towards Gavin and his taste of color)

Browsing through the online mail and forum archives is also tremendous fun; could be interesting to collect some of the milestones and funny anecdotes from these.

Coincidentally I get to celebrate this event by doing the first public training in Copenhagen about Hibernate on 5-6. December, see here for details. I'll look forward to be in the motherland to tell and teach about the current result of the 5 years journey.

I will also be presenting on Hibernate JPA and EJB3 in Copenhagen 4. December at Dansk-IT Java group meeting. You can see the program (in Danish) here .

See you in Copenhagen and to Hibernate and the team: Tillykke med fdselsdagen!

Hibernate Tools 3.2 Beta 7 released

Posted by    |       |    Tagged as

Hibernate Tools 3.2.0.beta7 ( have been made available.


One new major feature did go into this release (besides bugfixes and minor enhancements). Namely support for many-to-many tables during reverse engineering; so please go check that out if you have been waiting for it and give feedback at our forum and bugreports or enhancement requests at our JIRA .

See screenshots and other noteworthy news here for more information.

Query editing viewlet

I sat down and created a small viewlet of the HQL/JPAQL editing features we added in the previous release. That viewlet can be seen here , and one of the features it illustrates is shown in the following picture:

p.s. to enable this feature, you need an open Hibernate Console configuration and remember to enable Hibernate for you java project in the properties of your project.

Hibernate Tools 3.2 Beta 6 released

Posted by    |       |    Tagged as

Hibernate Tools 3.2.0.beta6 ( have been made available.

As always the tools are for both Eclipse and ANT.

It was actually released a couple of days ago, but a holiday got in the way of announcing it before now.

The big news for this release is that it is now compatible with Eclipse 3.2 and WTP 1.5, so we have hereby joined or are least compatible with the Callisto train.

Eclipse 3.2 has some new interesting extension points that we have made good use of to e.g. provide HQL code completion and validation inside the java code.

See screenshots and other noteworthy news here for more information.

On a side note, JBossWorld (as always) allowed me to get in contact with alot of users of the Hibernate Tools more directly and that was tremendous fun and interesting - Thanks. I got a lot of new input for new features and enhancements that should make it into future releases.

But remember that even though you did not make it to JBossWorld your feedback and contribution is always welcome at our forum and our JIRA .

Hibernate Tools for Ant, Eclipse and NetBeans

Posted by    |       |    Tagged as

Now that the dust is starting to settle from JavaOne it is time to explain what the announcement from JBoss about joining and endorsing NetBeans means in context of Hibernate Tools.

The core of Hibernate Tools have always and will always be independent of any IDE; these are available via our <hibernate-tool> Ant task.

Hibernate Tools for Eclipse will still be developed and improved. At JBossWorld we will have a release with new features and it will be compatible with Eclipse 3.2 and WTP 1.5 (Callisto), and for the brave the nightly builds should soon be the Callisto-based version.

In other words we are not moving away from Eclipse, we are simply recognizing the great work that the NetBeans community have been doing especially with respect to Java EE 5 tooling.

Thus for NetBeans and Hibernate Tools we gladly accepted a contribution from Leon Chiver which brings some of the Hibernate Tools for Eclipse features to the NetBeans platform, primarily the HQL editor (thank you Leon). We expect to also release a preview of this around JBossWorld.

Already with the initial contribution we have created a shared code set for the HQL code completion which actually resulted in merging both of best worlds and improving the functionality in both the Eclipse and NetBeans plugins.

We plan to align the feature set of the IDE tooling with help from the community and have the plugins share as much code as feasible to allow contributions in both camps to benefit each other. I look forward to hear from you what features you want the most.

There is more news coming and if you are curious come and hear more about them at JBossWorld Las Vegas. I and others from the Hibernate and JBoss IDE Team will be there.

Hibernate Tools 3.1 Beta 5 released

Posted by    |       |    Tagged as

Hibernate Tools 3.1.0.beta5 ( have been made available.

The tools are for both Eclipse and ANT.

This version is where the template functionallity is finally based on FreeMarker.

As an extra treat the tools now bundle a FreeMarker plugin to help out when writing custom templates (Thanks to Joe Hudson).

ANT users also get a most-wanted feature, namely removal of the old requirement of having to specify all mapped classes in hibernate.cfg.xml when e.g. generating the schema based on EJB3 annotated classes.

The new <ejb3configuration> support in the ant task allows standard EJB3 persistence packaged projects to be automatically scanned for mappings and then used like any other Hibernate compatible configuration.

See screenshots and other noteworthy news at here for more information.

Hibernate 3.2: Transformers for HQL and SQL

Posted by    |       |    Tagged as Hibernate ORM

People using the Criteria API have either transparently or knowingly used a ResultTransformer . A ResultTransformer is a nice and simple interface that allows you to transform any Criteria result element. E.g. you can make any Criteria result be returned as a java.util.Map or as a non-entity Bean.

Criteria Transformers

Imagine you have a StudentDTO class:

public class StudentDTO {
  private String studentName;
  private String courseDescription;
  public StudentDTO() { }

Then you can make the Criteria return non-entity classes instead of scalars or entities by applying a ResultTransformer:

List resultWithAliasedBean = s.createCriteria(Enrolment.class)
  .createAlias("student", "st").createAlias("course", "co")
  .setProjection( Projections.projectionList()
                   .add(""), "studentName" )
                   .add("co.description"), "courseDescription" )
          .setResultTransformer( Transformers.aliasToBean(StudentDTO.class) )

 StudentDTO dto = (StudentDTO)resultWithAliasedBean.get(0);  

This is how ResultTransformer have been available since we introduced projection to the Criteria API in Hibernate 3.

It is just one example of the built in transformers and users can provide their own transformers if they so please.

Jealous programming

Since I am more a HQL/SQL guy I have been jealous on Criteria for having this feature and I have seen many requests for adding it to all our query facilities.

Today I put an end to this jealousy and introduced ResultTransformer for HQL and SQL in Hibernate 3.2.

HQL Transformers

In HQL we already had a kind of result transformers via the (select new syntax, but for returning non-entity beans it only provided value injection of these beans via its constructor. Thus if you used the same DTO in many different scenarios you could end up having many constructors on this DTO purely for allowing the select new functionality to work.

Now you can get the value injected via property methods or fields instead, removing the need for explicit constructors.

List resultWithAliasedBean = s.createQuery(
  "select as studentName," +
  "       e.course.description as courseDescription" +
  "from   Enrolment as e")
  .setResultTransformer( Transformers.aliasToBean(StudentDTO.class))

StudentDTO dto = (StudentDTO) resultWithAliasedBean.get(0);

SQL Transformers

With native sql returning non-entity beans or Map's is often more useful instead of basic Object[]. With result transformers that is now possible.

List resultWithAliasedBean = s.createSQLQuery(
  "SELECT as studentName, co.description as courseDescription " +
  "FROM Enrolment e " +
  "INNER JOIN Student st on e.studentId=st.studentId " +
  "INNER JOIN Course co on e.courseCode=co.courseCode")
  .setResultTransformer( Transformers.aliasToBean(StudentDTO.class))

StudentDTO dto =(StudentDTO) resultWithAliasedBean.get(0);

Tip: the addScalar() calls were required on HSQLDB to make it match a property name since it returns column names in all uppercase (e.g. STUDENTNAME). This could also be solved with a custom transformer that search the property names instead of using exact match - maybe we should provide a fuzzyAliasToBean() method ;)

Map vs. Object[]

Since you can also use a transformer that return a Map from alias to value/entity (e.g. Transformers.ALIASTOMAP), you are no longer required to mess with index based Object arrays when working with a result.

List iter = s.createQuery(
  "select as studentName," +
  "       e.course.description as courseDescription" +
  "from   Enrolment as e")
  .setResultTransformer( Transformers.ALIAS_TO_MAP )

String name = (Map)("studentName");

Again, this works equally well for Criteria, HQL and native SQL.

Reaching Nirvana of native sql

We still miss a few things, but with the addition of ResultTranformer support for SQL and the other additions lately to the native sql functionality in Hibernate we are close to reach the Nirvana of native sql support.

Combined with StatelessSession you actually now got a very flexible and full powered sql executor which transparently can map to and from objects with native sql without any ORM overhead.

...and when you get tired of managing the sql, objectstate, lifecycles, caching etc. of your objects manually and want to benefit from the power of an ORM then you got it all readily available to you ;)

back to top