-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Can I map a resultset without mapping all tables related?
PostPosted: Fri Apr 04, 2008 9:08 am 
Newbie

Joined: Thu Apr 03, 2008 11:09 am
Posts: 3
Hi,

How can I map a native SQL query like the following?

Code:
select
          a.id        as   ID
          a.qty     as   Quantity
          a.cal as   Calories         
          b.name  as   Object_1
          c.name  as   Object_2         
from
       objHead a,
       Fruits b,
       Sweets c
where
       a.id = b.id
       and a.id = c.id           


How can I map a resultset like this into a class Items which has:

Quote:
public class Items{

private String id;
private String Quantity;
private String Calories;
private String Object_1;
private String Obejct_2;

// getter and setter mathdos
....
}


I do not want to map 3 tables, I do not care about them, I need only the recordset and display results on my webpage.

Any help?
thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.