Click here to Skip to main content
14,640,670 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have this:

-Customer.java:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
    private List<order> order = new ArrayList();


-order.java:
@ManyToOne
    private Customer customer;


-SoldBook.java
@ManyToOne
    private Order order



Is it possible to get a querry that appear if a customer bought a book?

What I have tried:

I tried to do:

SELECT l.order FROM soldBook l INNER JOIN l.order p  INNER JOIN p.customer c WHERE l.customer = :” +customer
Posted
Comments
MadMyche 14-Jan-19 16:53pm
   
Please provide the schema for that tables used to populate those objects

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100