-
1. Re: Seam gen tool bug!!!
pmuir May 12, 2008 3:48 PM (in response to huixjan.huixjan.gmail.com)Huh?
-
2. Re: Seam gen tool bug!!!
huixjan.huixjan.gmail.com May 13, 2008 12:57 PM (in response to huixjan.huixjan.gmail.com)package org.test; import java.io.Serializable; public class TestBean implements Serializable { private static final long serialVersionUID = 7245129069051557549L; private String name; private String address; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getADdress() { return address; } public void setADdress(String address) { this.address = address; } }
import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import org.test.TestBean; public class Main { public static void main(String[] args) { PropertyDescriptor[] descriptors = null; try { BeanInfo info = Introspector.getBeanInfo(TestBean.class); descriptors = info.getPropertyDescriptors(); } catch (IntrospectionException e) { e.printStackTrace(); } for (PropertyDescriptor pd: descriptors) { System.out.println(pd.getName()); } } }
The test code is same with java EL javax.el.BeanELResolver.
You can get the resualt as:
ADdress name
I think this's a seam-gen bug,org.jboss.seam.tool.Util.java,org.jboss.seam.tool.LowercasePropertyTask.java lower() has some error.
Thanks for your help!
-
3. Re: Seam gen tool bug!!!
pmuir May 13, 2008 1:13 PM (in response to huixjan.huixjan.gmail.com)So you are saying that, for a getter/setter pair for ADdress, seam-gen will generate aDdress? But that it should be ADress according to JavaBean rules?
-
4. Re: Seam gen tool bug!!!
stephen May 13, 2008 6:13 PM (in response to huixjan.huixjan.gmail.com)We had the same problem with a hand-written application.
I am not sure that JavaBean spec defines the property name to beADress
, but it seems that's the way some piece of software in the stack wants to have it (Seam's or the JSF default EL resolver?).(We just changed the method names...)
-
5. Re: Seam gen tool bug!!!
pmuir May 13, 2008 6:34 PM (in response to huixjan.huixjan.gmail.com)
I am not sure that JavaBean spec defines the property name to be ADress,It does. See section 8.8 - if the first letter is upper case and the second lower, it de-captilizes the first letter. If both the first and second letters are capital letters, then it leaves it alone.
Please file a JIRA issue, noting places in Seam where you have seen this occur and we can fix it.
-
6. Re: Seam gen tool bug!!!
huixjan.huixjan.gmail.com May 14, 2008 5:55 AM (in response to huixjan.huixjan.gmail.com)Pete Muir,Thanks!
I'm a chinese,write english is difficult for me.Maybe some grammar error with my talking.Thanks for your help.
When I use seam-gen,I find the same things(no exceptions throws) with generated EntityBean properties,JavaBean name is error.I think EntityBean freemarker template also need changed.
Another:
http://jira.jboss.com/jira/browse/JBSEAM-596The same errors When I user derby database with column type:LONG VARCHAR.I check the source code,it's a hibernate org.hibernate.mapping.Table.validateColumns() error.I know this method has some bugs.When run into org.hibernate.tool.hbm2ddl.ColumnMetadata line 26(Hibernate 3.2.6GA),typeName is changed as LONG,so throw HibernateException:
Found: LONG, expected: varchar
.I comment a line in META-INF/persistence.xml:
<property name="hibernate.hbm2ddl.auto" value="validate"/>
The application work right.I suggest change persistence.xml file's freemarker template,disable schema validator.So,someone won't be in trouble when run the seam generated code.