-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate benefit or hinderance - clean mapping not possible
PostPosted: Mon Feb 07, 2005 3:58 pm 
Newbie

Joined: Mon Feb 07, 2005 3:46 pm
Posts: 5
This question is based on Hibernate 2 the latest as of this posting. I did a great deal of reading on hibernate before posting this to make sure I couldn't get a clear answer from somewhere else before resorting to "bugging" the forum for a better answer.

The Problem:
I am developing an applicaiton which has need of getting data in as agnostic a database fashion as possible, however the query that will give me the data that I want is complex and requires a feature that I know is not in Hibernate now from reading the available docs. The query in question is a UNION ALL of disperate data sets. I have experience with ORM (ala OJB) but no experience with Hibernate per se.

The Question:
Knowing the above problem - is there a direct benefit to using hibernate's framework and structure despite the fact that I have to issue my own query to get the data that I want? i.e. In the situation where I have to issue my own query for data, is there a benefit to using Hibernate over say just writing a java object to execute a query and return the result set? Take into account there would be frame work around jdbc connections and pooling etc.

Thoughts? Help? Comments? I will take ANY and ALL input I can get, because this project has a VERY SHOOOOOOORRRRTTTTT development period (April 1 deadline) and I am only coming into the project now. A decision HAS to be made.

Thanks,
Joe Campbell
joe.campbell@guideworkstv.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 07, 2005 5:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
If you have only one query in your application, do not use Hibernate. That's insane. Hibernate is for applications with sophisticated data requirements.


(By the way, in Hibernate, you can use a UNION ALL in a native SQL query.)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 08, 2005 9:08 am 
Newbie

Joined: Mon Feb 07, 2005 3:46 pm
Posts: 5
True - sorry for not being clear enough... there is more then one single query, but they are all themes on two base queries returning essentially the same data. Noting that I can do my own query setup in Hibernate (like the post reponse suggests) is there still a benefit to using the hibernate framework? If so what is it or what are they?

Thanks in advance,
Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 09, 2005 1:28 am 
Newbie

Joined: Sun Feb 06, 2005 1:42 pm
Posts: 4
Is this complex query being mapped to an object (java class)?

If not, then there's no benefit to using Hibernate, which is an *OBJECT*-relational mapping tool.

If yes, then since your post indicates that your "application [has a] need of getting data in as agnostic a database fashion as possible", I assume that means you don't have any say in the design of the database, which I further assume means you do have some say in the design of the objects. So maybe try breaking up your objects into simpler objects, which might simplify the queries.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 09, 2005 4:25 am 
Beginner
Beginner

Joined: Tue Feb 08, 2005 7:01 am
Posts: 21
(although I only have a week experience with Hibernate) I would say if the sole benefit you expect from hibernate is database independence then this is not the tool you need for this project. Database independence is only a side-effect of hibernate and only in fortunate circumstances.


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