-->
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.  [ 6 posts ] 
Author Message
 Post subject: using hibernate sql generator only
PostPosted: Wed Mar 17, 2004 7:19 am 
Newbie

Joined: Wed Mar 17, 2004 7:10 am
Posts: 1
Hi,

I'm quite new to Hibernate, but think that it's mostly for mapping an Java object graph to SQL. This is very interesting. However not quite what I want to use it for (at this stage).

What I want to know is if it would be possible to use the HQL for generating SQL for different RDBMSs? Our 'problem' is that we need to execute queries on tables that are dynamic, i.e. we will not know the exact table design up front, so we will not be able to generate a Hibernate mapping up front (before starting the application). Because we need to support multiple RDMSs it would be nice if we could constuct a HQL query and have Hibernate spit out the SQL (for the concrete RDBMS). Is it possible to (mis)use Hibernate for this purpose?

I have read through (a lot of) the documentation, but could not find any information on this.

Thanks in advance for your input,

Hendrik


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 11:17 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It should be possible (it's OS) but you'll touch internal APIs
Did you read that one http://www.hibernate.org/171.html

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And rewrite big parts

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 1:35 pm 
Newbie

Joined: Wed Feb 11, 2004 10:07 am
Posts: 2
Hendrik,

I am surprised as well, there seems to be no way of trapping the plain SQL gracefully. It sounds weird that Gavin has given way to print it out to console, but not be able to retreive it through an API.

Strange indeed. Still looking for a way to do that.

-Anand


Top
 Profile  
 
 Post subject: Re: using hibernate sql generator only
PostPosted: Wed Mar 17, 2004 1:54 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
hendrik wrote:
Is it possible to (mis)use Hibernate for this purpose?

Yes, it is.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 5:45 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Actually doing that in the JDBC layer (with a JDBC wrapper) is far better I think. You'll get *every* DB access.

_________________
Emmanuel


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