how to restrict to specific columns of both tables data when joining two tables in hibernate

i am joining two tables and fetching data from both tables.

String hql = "from Supplier s inner join fetch s.products as p";
              Query query = session.createQuery(hql);

it will execute below query;

select as id1_0_, as id0_1_, as name1_0_, as name0_1_, products1_.description as descript3_0_1_, products1_.price as price0_1_, products1_.supplierId as supplierId0__, as id0__ from Supplier supplier0_ inner join Products products1_ on

if i have 50 columns in Supplier and 100 columns in Products table then all those columns will come in this query;i want only specific columns  say 10 columns from both of these tables supplier and products then how will u reqrite this query?
LVL 20
chaitu chaituAsked:
Who is Participating?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.