tlaukkan / vaadin-lazyquerycontainer

Lazy Query Container is a lazy loading container implementation for accessing data from business services.
http://vaadin.com/directory#addon/117
39 stars 73 forks source link

LazyEntityContainer problem with boolean property of POJO #79

Closed lebb closed 8 years ago

lebb commented 9 years ago

If my POJO has a boolean property with the getter prefix 'is' LazyEntityContainer does not recognize the property and tires to cast the property as String.

Example

private boolean enabled;

public boolean isEnabled(){ return enabled; } public void setEnabled(boolean enabled){ this.enabled = enabled; }

lazyEntityContainer.addContainerProperty("enabled", Boolean.class, "", false, true);

Workaround:

changing the prefix 'is' of the getter method for 'get'

private boolean enabled;

public boolean getEnabled(){ return enabled; } public void setEnabled(boolean enabled){ this.enabled = enabled; }

lazyEntityContainer.addContainerProperty("enabled", Boolean.class, "", false, true);

the default auto-generted method for a boolean property in Netbeans uses the 'is' prefix causing this bug.

It would be a good idea to accept both 'is' and 'get' prefix for a boolean property getter method.

tlaukkan commented 8 years ago

Does not seem to repeat with latest Vaadin version. See unit test EntityContainerAttachedEntitiesPropertyIdsTest and "author.valid".