-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can hibernate do this?
PostPosted: Sun Oct 03, 2004 1:43 pm 
Newbie

Joined: Sun Oct 03, 2004 12:49 pm
Posts: 1
Location: Belgium
Hi,

I've been looking around a bit everywhere and at the hibernate doc. So far I haven't found what I've been looking for.

Basically I want to know if you can use hibernate to perform queries on several tables and return the results as objects?

For instance I want show an overview of the top buying customers.
What I do now is the following:

-Use jdbc to execute a query.
-Return a list of objects.

The objects aren't directly mapped to a single table.
Have no relationships.
They're just statistical data objects.

What I would like to do is use Hibernate's HQL to write the query and have it automatically send me back objects.
I've thought of using table views. That would probaply accomplish it, but it 'd mean that I'd have to port my views to every possible db.
I'd like to stay database neutral!
Anybody know how this can be done, if it can be done?

If possible I'd appreciate pointers to online doc or example code would be most helpful.

Thx!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 03, 2004 4:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can do things like "select new ResultObject(x.id, a.sum) from ..."


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.