JAVA JPA Join relations for multiple tables

E.g. we have sql below


 select A.id, A.name, B.name2, C.name2 from A,B,C where A.id=B.bid and B.name3 = C.id

We use join to connect JPA tables

//    Root rootpath   Entity A,B,C  in B has relasionship B.name3 = C

    Join b_path = rootpath.join("id");

    Join c_path = b_path.join("name3");

Leave a Reply

Your email address will not be published. Required fields are marked *