Setter for a boolean named isActive

I have a property called isActive in my pojo class. When I created accessors for this property using the Eclipse IDE, it generates the following getters and setters

Getter : isActive()
Setter : setActive()

However, when I try to write this property using the ibatis framework, specifying the property name as "isActive", it reveals that it cannot find a WRITEABLE named "isActive". The problem, I think, is that you cannot output the correct property name by outputting setter as setIsActive ().

What is the best way to get around this without changing the name of the property or getter?

+5
source share
5 answers

getters isFieldName. , Ibatis active not isActive

+7

pojo boolean , xxx, isXxx setXxx.

pojo;

public class MyPojo
{
  private boolean active;

  public boolean isActive()
  {
    return active;
  }

  public void setActive(boolean active)
  {
    this.active = active;
  }
}

, IDE private boolean active, IDE .

+5

.

Windows → → Java → "" - ... "(, , , ).

Getter : getIsActive()
Setter : setIsActive()

, .

0

iBatis, Hibernate . ORM .

0

. , , - pojo, ibatis, , . 2.3.4 2.3.0, , . , java beans asActive() setIsActive() accessors, boolean primitive isActive. !

0

All Articles