如果我有一个扩展了其他实体的实体,则无法在我的代理接口中指定某些设置方法。 Eclipse告诉我,在Entity类中没有匹配的方法。没错,因为它属于超类。无法要求工厂处理该继承,或者仅仅是我日食中的一些配置问题。 (我为该请求工厂验证设置了注释处理材料)

这里是示例代码:
我的实体。没有方法,但应从超类继承它们:

@Entity
public class Entity extend AbstractEntity{

}


超类。持有setter和getter:

public class AbstractEntity{
    VoteType getType(){ return null; }
    public void setType(VoteType vote) {}
}


我的代理界面。 Eclipse将setType()方法标记为错误。 (但不是getType()吗?)

@ProxyFor(value=Entity.class)
public interface EntityProxy extends EntityProxy{

    public VoteType getType();
    public void setType(VoteType vote);

}

最佳答案

根据docs,您的Entity类应具有@Entity批注,而EntityProxy接口应扩展EntityProxy接口。

07-24 19:10
查看更多