?
Solved

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

Posted on 2007-03-30
1
Medium Priority
?
203 Views
Last Modified: 2013-11-24
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 supplier0_.id as id1_0_, products1_.id as id0_1_, supplier0_.name as name1_0_, products1_.name as name0_1_, products1_.description as descript3_0_1_, products1_.price as price0_1_, products1_.supplierId as supplierId0__, products1_.id as id0__ from Supplier supplier0_ inner join Products products1_ on supplier0_.id=products1_.supplierId

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?
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 1500 total points
ID: 18824506
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question