Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polymorphism-aware entity view validation #180

Closed
Mobe91 opened this issue Dec 30, 2015 · 2 comments
Closed

Polymorphism-aware entity view validation #180

Mobe91 opened this issue Dec 30, 2015 · 2 comments

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Dec 30, 2015

In the following entity view scenario, the view validation fails because AbstractOffer does have a mapped property 'foo'.

@EntityView(AbstractOffer.class)
public interface ProductVariantOfferView {
   public Boolean getFoo();
}
@Entity
public class AbstractOffer { }
@Entity
public class WebShopOffer extends AbstractOffer { }
@Entity
public class PhysicalShopOffer extends AbstractOffer {
   private boolean foo;

   public Boolean getFoo() {
        return foo;
    }

    public void setFoo(Boolean foo) {
        this.foo = foo;
    }
}
@beikov
Copy link
Member

beikov commented Feb 4, 2016

I think the only good way to support this kind of mapping would be to implement it with the TREAT operator(#120). You would have a mapping like @Mapping("TREAT(this AS PhysicalShopOffer).foo") which would also require the introduction of an implicit this alias.

@beikov
Copy link
Member

beikov commented Mar 10, 2017

Superseded by #312

@beikov beikov closed this as completed Mar 10, 2017
@beikov beikov added this to the 1.2.0 milestone Mar 10, 2017
@beikov beikov self-assigned this Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants