I have confirmed with the Java Bean Spec 1.01 that either form is acceptable. See
http://java.sun.com/products/javabeans/docs/spec.html
And I looked at the code so I am pretty sure there is no way to choose.
I have an idea for a patch.
Can anyone tell me the best way to submit it?
Code:
--- tools/src/java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java (revision 14167)
+++ tools/src/java/org/hibernate/tool/hbm2x/pojo/BasicPOJOClass.java (working copy)
@@ -566,7 +566,11 @@
* @return String
*/
public String getGetterSignature(Property p) {
- String prefix = c2j.getJavaTypeName( p, false).equals( "boolean" ) ? "is" : "get";
+ String prefix = "get";
+ if ( c2j.getJavaTypeName(p, false).equals( "boolean" ) ) {
+ MetaAttribute bgp = p.getMetaAttribute("boolean-getter-prefix");
+ prefix = (bgp == null) ? "is" : MetaAttributeHelper.getMetaAsString(bgp);
+ }
return prefix + beanCapitalize( p.getName() );
}
Then you can add
Code:
<meta attribute="boolean-getter-prefix">get</meta>
and get what you want.