[jboss-user] [JBoss Seam] - Re: seam-gen enhancement

awhitford do-not-reply at jboss.com
Tue Feb 13 17:07:52 EST 2007


Good work Kent!  I can't wait to try this...

I can't stress how important this feature is because the reverse engineering approach makes a lot of incorrect assumptions.  The Entity bean provides much richer information for CRUD generation.

Some problems that I have run into with reverse engineering include:
  | * I have run into problems dealing with Dates because the database (SQL Server) only has one date type (datetime) for dates, times, and timestamps.  However, if you look at my Entity bean, it clearly has the field tagged with a Temporal annotation (@Temporal(TemporalType.DATE)).
  | 
  | * I have run into problems with Enumerated types.  To the database, I often store enum values as Strings, so the reverse engineering makes the field a String rather than an enum.  My Entity bean has an enum annotated (@Enumerated(EnumType.STRING)).
  | 
  | * I rarely override the columnDefinition (for an enum code or iso code, for example).  The reverse engineering translates char(n) columns to be varchar(n), then deployment fails because Hibernate does some validation.
  | 
  | * Foreign Key constraints often creates unneccesary object coupling.  For example, I have an Exchange object that has a ManyToOne relationship with a Country.  Reverse engineering will create the Country object with a set of Exchanges.  In truth, Country should not really know about its Exchanges, but an Exchange must know its Country.
  | 
Because of these problems, I am often only able to use Seam-gen as a very rough guide because it often doesn't yield a working solution.  I definitely am not expecting perfection, but there is clearly an information gap due to reverse engineering that can be mitigated by using the Entity beans directly.

I recognize Seam-gen as an invaluable tool for Seam development.  It has definitely saved me time, but this enhancement makes it 100 times more useful.  I'm crossing my fingers for 1.1.7.  ;-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016060#4016060

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016060



More information about the jboss-user mailing list