如果我有一个扩展其他实体的实体,我不能在我的代理接口(interface)中指定一些 setter 方法。 Eclipse 告诉我在我的实体类中没有匹配的方法。这是真的,因为它在父类(super class)中。无法请求工厂处理该继承,或者它只是我的 eclipse 中的一些配置问题。 (我为请求工厂验证设置了注释处理内容)
这里是示例代码: 我的实体。没有方法但应该从父类(super class)继承它们:
@Entity
public class Entity extend AbstractEntity{
}
父类(super class)。持有 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 接口(interface)应扩展 EntityProxy 接口(interface)。
关于java - 请求工厂实体继承和代理接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18272361/