Hi,

I have a JPA entity model that has the following chain of relationships:

Order_JpaImpl {
@OneToMany(mappedBy = "order", fetch = FetchType.EAGER, cascade = {CascadeType.ALL})
    List< OrderLine_JpaImpl> orderLines = new LinkedList<>();
}

OrderLine_JpaImpl {
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "prdId", nullable = false)
    @ForeignKey
    @Index
    private Product_JpaImpl orderLineItem;
}

Product_JpaImpl {
@ManyToOne( cascade = {}, targetEntity = Show_JpaImpl.class, fetch = FetchType.EAGER )
    @JoinColumn( name="shwId", nullable = false )
    @ForeignKey
    @Index
    private Show_JpaImpl show;
}

Show_JpaImpl {
    @Column( length = 32, unique = true, nullable = false )
    private String shortName;
}

I want to use FIQL to get all the orders that include orderlines that have products from a given show.
So I have a simple search expression: show==AMND
And a mapping:
    private static Map<String,String> createBeanNameMap() {
        Map<String,String> map = new HashMap<>();
        map.put("customerdisplay","customerDisplay");
        map.put("ordertime","orderTime");
        map.put("fulfilmentstatus","fulfilmentStatus");
        map.put("show","orderLines.orderLineItem.show.shortName");
        return map;
    }
That is used by:
SearchCondition<ImplType> searchCondition = searchContext.getCondition(targetClass, getBeanNameMap());

And that always returns null :(

I think what I'm trying to achieve is equivalent to the "all the books with good reviews written by Ted" example at http://cxf.apache.org/docs/jax-rs-search.html, but I'm getting an error inside the parser when it finds that orderLines is a List.

So my question is, should this work?
Is it supposed to be possible to go via a one-to-many join and return parents with a child that matches?

I'm using CXF 2.7.7.

Thanks.

Jim

Reply via email to