Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: boolean variable is-, getter and setter methods
PostPosted: Thu Oct 21, 2010 12:07 pm 
Newbie

Joined: Thu Oct 21, 2010 10:50 am
Posts: 2
Hello.
I've been checking the forum for this problem but didn't found the same problem. Apologize in case it was already posted

This is the scenario:
I have two classes like
class A{
private boolean isMove
public boolean isMove() {
return isMove;
}
public void setMove(boolean isMove) {
this.isMove = isMove;
}
}
class B extends A
...

I persist B in a table using hibernate
<class name="B" table="tabb">
<id name="id" column="id_plan" >
<generator class="increment"/>
</id>

...
<property name="isMove" column="is_move" />
</class>

With this code, I get the following execution error:
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

If I modify the name of the getter and setter method of A like that:
public boolean getIsMove() {
return isMove;
}
public void setIsMove(boolean isMove) {
this.isMove = isMove;
}

then everything works fine.
It is an overhead, as I cannot use anymore automatic code generation with eclipse and I would have to refactor several methods.
In the Tutorial, it is stated that Hibernate uses standard JavaBean naming conventions but isMove and setMove are standard. It is also stated that it is not mandatory to provide getters and setters, as hibernate can get access to private variables.
What is then the problem?

Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.