[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Weaving and targetEntity


I'm in the process of adding static weaving to our application and have run into a bit of a problem. All of my relationship targets are interfaces that have a single implementer, so I use the "targetEntity" property liberally in my mapping annotations.

For example, where class B implements interface IB, the getter and setter in class A look like:

    private IB b;

    @OneToOne(cascade = CascadeType.ALL,
              targetEntity = B.class,
              fetch = FetchType.LAZY)
    public IB getB() {
        return b;

    public void setB(IB newB) {
        b = newB;

This worked without any issues until I enabled static weaving. Now, whenever I try to persist an entity, I receive a java.lang.NoSuchMethodException indicating that there is no setter method with the appropriate signature. What confuses me is that (considering the example above) the desired setter method signature is "setB(B)", whereas I would expect it to be "setB(IB)". Am I missing some obvious configuration or setting that would allow the interfaces to be used instead of the concrete classes?

Best regards, Zeb Ford-Reitz

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature