I'm having a problem with active objects library (https://java.net/projects/activeobjects/pages/Home).
Let's say i have ao entity like this:
@Implementation(PersonImpl.class)
interface Person extends Entity{
public String getName();
public String setName();
}
And the implementation class of this entity :
class PersonImpl {
private Person person;
public PersonImpl(Person person){
this.person = person;
}
public String getName(){
if( isTodayIsMonday() )
return "I hate monday";
else
return person.getName();
}
}
Problem is in PersonImpl
class. Because of person.getName()
I get infinite recursion (impl class is always invoked). How can I skip invoking implementation (in PersonImpl
class) and just get name from database?