-->
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: Hibernate generating sql query wrong
PostPosted: Wed Sep 27, 2006 6:25 pm 
Newbie

Joined: Wed Sep 27, 2006 6:10 pm
Posts: 8
i have an entity bean that is querying a mysql 5 database (jboss/ejb3/hibernate3). the query is failing because when it builds the from clause, it formats it like this:

databasename.databasename.tablename

i take out the first databasename and plug it into query browser it works perfectly. any ideas on this?

when i defined the bean, i didn't put in any database name because when the app is deployed, there is no garuntee that the database name will be the same. thats what connection strings are for.


Top
 Profile  
 
 Post subject: Re: Hibernate generating sql query wrong
PostPosted: Wed Sep 27, 2006 6:37 pm 
Beginner
Beginner

Joined: Sat Sep 23, 2006 5:44 pm
Posts: 22
Location: Seattle, WA
You might see what the settings are for:

hibernate.default_schema Qualify unqualified tablenames with the given schema/tablespace in generated SQL.

hibernate.default_catalog Qualify unqualified tablenames with the given catalog in generated SQL.

Section 3.4 in the manual.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 7:57 pm 
Newbie

Joined: Wed Sep 27, 2006 6:10 pm
Posts: 8
i tried both of those, same thing. puts databasename.databasename.table in the from clause.


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.