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
Solved

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

Posted on 2007-03-30
1
194 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
1 Comment
 
LVL 23

Accepted Solution

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

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

839 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