[jboss-user] [JBoss Seam] - s:convertEntity with non-numeric @Id

awhitford do-not-reply at jboss.com
Tue Jun 12 14:16:17 EDT 2007


According to the documentation:
anonymous wrote : 
  | The converter works with any entity which has an @Id annotation - either simple or composite.
  | 
But if I try to use it with an Entity that has a String as the @Id, I get a NumberFormatException:

  | java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
  | java.lang.Integer.parseInt(Integer.java:447)
  | java.lang.Integer.<init>(Integer.java:620)
  | org.jboss.seam.ui.EntityConverter.getAsObject(EntityConverter.java:80)
  | com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:152)
  | 
So this would lead me to believe that it works only for numbers.  Can this please be emphasized in the documentation?


So what do I need to do?  I guess I need to delcare my own converter?  And then how do I get it wired in?

Or could EntityConverter be enhanced to handle String @Id Entities?  (Overload the get method in EntityConverterStore, and do some kind of class meta-data check in EntityConverter?)


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

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



More information about the jboss-user mailing list