Saturday, February 26, 2011

Bug: Boolean Accessors Prefixed with "is" not recognized as attribute in JDeveloper

The biggest fail that I noticed in JDeveloper (aka Patch Set 3) is the inability to recognized boolean properties that are prefixed with "is" like isActive() as property in the entity xml files. My disappointment is that- this is properly recognized in earlier releases. We wanted to jive with the most recent release, so we have a lot of refactoring to make.
Below is a sample entity class and the corresponding entity xml file that was generated by JDev:
package model;

public class Employee {
    private Long id;
    private Boolean active;
    private String firstName;
    private String lastName;

    public void setActive(Boolean active) { = active;

    public Boolean isActive() {
        return active;

    public void setId(Long id) { = id;

    public Long getId() {
        return id;

    public void setFirstName(String firstName) {
        this.firstName = firstName;

    public String getFirstName() {
        return firstName;

    public void setLastName(String lastName) {
        this.lastName = lastName;

    public String getLastName() {
        return lastName;
Generated xml:
<?xml version="1.0" encoding="UTF-8" ?>
<JavaBean xmlns="" version=""
          id="Employee" Package="model" BeanClass="model.Employee"
  <Attribute Name="id" Type="java.lang.Long"/>
  <Attribute Name="firstName" Type="java.lang.String"/>
  <Attribute Name="lastName" Type="java.lang.String"/>
  <MethodAccessor IsCollection="false" Type="void" id="setActive"
    <ParameterInfo id="active" Type="java.lang.Boolean" isStructured="false"/>
  <MethodAccessor IsCollection="false" Type="java.lang.Boolean" id="isActive"
  <ConstructorMethod IsCollection="true" Type="model.Employee"
                     BeanClass="model.Employee" id="Employee"/>
Notice that isActive() is not part of the attributes.