-->
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.  [ 3 posts ] 
Author Message
 Post subject: Retrieving only certain columns
PostPosted: Wed May 05, 2004 10:03 pm 
Newbie

Joined: Wed May 05, 2004 9:51 pm
Posts: 1
Lets say you have the following table:

CREATE TABLE MYTABLE {
ID numeric (9, 0) IDENTITY NOT NULL,
FIELD1 varchar(50),
FIELD2 varchar(50),
FIELD3 varchar(50),
....
FIELD10 varchar(50),
}

And lets say you have two views of that data. One, is a table displaying all rows (or pages) of data, butonly displaying the ID, FIELD1 and FIELD2. The second view is a view of all the columns of an individual row.

Is this possible in Hibernate? Suggestions? Pointers in the right direction?

Thanks.

-bryce


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 06, 2004 3:09 am 
Newbie

Joined: Tue Oct 21, 2003 1:25 pm
Posts: 14
Location: Los Angeles, CA
If I understand you correctly:

The first senario would be a Object containing 3 fields, and a mapping to that table and three of the colums. You would access this by individual IDs.

The second senario is a similar Object (A devrived class maybe? Composite? Decorator?) containing all 11 fields, and a mapping to that table with all the collums. You would access this via the equlivent of a 'select *' statement to get a list of all rows in the table.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 06, 2004 6:15 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
projection
one-to-one
lightweight pattern

PS: in most cases returning all the properties does not decrease performance.

_________________
Emmanuel


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

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.