Monday, February 15, 2010

Seam 2.2 + Jboss 5.1: a resolution

A few weeks ago I posted about my difficulties migrating to new versions of jboss and seam.

I was finally able to resolve these difficulties by following these steps:

  • I first took the suggestion of this post on seamframework.org and used seam-gen to generate a basic seam application that worked with my existing database.

  • I then replaced all the libraries with the ones from the newly generated application.

  • As a penultimate step I followed the procedure outlined in the migration guide.


I was now able to search for differences between the new and the old version.
The primary differences were in the *List.java classes

--the new version of the code followed the pattern:

private static final String[] RESTRICTIONS = {“lower(shows.name) like concat(lower(#{showsList.shows.name}),’%’)”,};
private static final String EJBQL = “select shows from Shows shows”;
@SuppressWarnings(“unchecked”)
public ShowsList() {
setEjbql(EJBQL);
setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
setMaxResults(25);
}


--- the pattern in the old version was:

private static final String[] RESTRICTIONS = {“lower(shows.name) like concat(lower(#{showsList.shows.name}),’%’)”,};
private Shows shows = new Shows();
@Override
public String getEjbql() {
return “select shows from Shows shows”;
}
@Override
public Integer getMaxResults() {
return 25;
}


The primary difference is that the restrictions used the setRestrictionExpressionStrings method. As one of the commenters on the seamframeworks post mentioned: it would have been good to have discussed this in the migration document.

Not a tremendously big deal but, as I said previously, disappointing.

No comments: