Hi all,
I have a problem with how hibernate/JavaBeans constructs property names.
Here's my property.
private boolean aNumberFl;
@Column( name = "aNumberFl", nullable = false )
@Type( type = "yes_no" )
public boolean getANumberFl()
{
return aNumberFl;
}
public void setANumberFl( boolean var )
{
this.aNumberFl = var;
}
Everything is fine except for fact the hibernate internally thinks my property names is ANumberFl rather than aNumberFl. The JavaBean conventions checks the first two chars of the property getter (after the get) and if they are both capitals and does not uncapatilise to get the property name. However this is inconsistent with my field name which has a lower case. This is all permissible in JavaBean world but having a field called aNumberFl
OR ANumberFl
would yield the same getter name. This means when the get method is the source it has to pick one of the other, and is picking the latter.
I tried moving the annotations onto the field but that caused other issues which I won't go into now, and am not sure that's a good idea anyway.
Is there anyway of overriding the default property name that hibernate infers from the getter method name?
Thanks.