-->
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.  [ 7 posts ] 
Author Message
 Post subject: Consulting a database
PostPosted: Wed Oct 26, 2005 1:47 pm 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
Hello,
I have a hibernate based application working right but when i needed to transfer it to another database whith the similar tables i've seen (using Query analyser) that some tables must be queryed like this " select * from mediator.TableName " where mediator is the owner of the table and my queries at hibernate do " SessionFactory.find( "SELECT t from Table t order by t.codigo" ) " .
I wanted to include in my hibernate query mediator.Table , but thats imposible it shows the error:
And i've tried to connect (using Query analyser) whith the user mediator but my queries are accepted only like mediator.TableName

Some one can help me.


Top
 Profile  
 
 Post subject: Re: Consulting a database
PostPosted: Wed Oct 26, 2005 2:40 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
wladelin wrote:
Hello,
I have a hibernate based application working right but when i needed to transfer it to another database whith the similar tables i've seen (using Query analyser) that some tables must be queryed like this " select * from mediator.TableName " where mediator is the owner of the table and my queries at hibernate do " SessionFactory.find( "SELECT t from Table t order by t.codigo" ) " .
I wanted to include in my hibernate query mediator.Table , but thats imposible it shows the error:
And i've tried to connect (using Query analyser) whith the user mediator but my queries are accepted only like mediator.TableName

Some one can help me.


Try setting a Hibernate default Schema - section 4.4 in the reference docs.

hibernate.default_schema=mediator (in a properties file)

<property name="hibernate.default_schema">mediator</property> in hibernate.cfg.xml

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:03 am 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
hi pksiv i've tried your advice but i belive that this would work right if in all my table i must include mediator.TableName, but in some tables i must not use mediator.TableNamebut only TableName for example in my User's table which i use to logging in my sistem.

Thanks JP


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:06 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
wladelin wrote:
hi pksiv i've tried your advice but i belive that this would work right if in all my table i must include mediator.TableName, but in some tables i must not use mediator.TableNamebut only TableName for example in my User's table which i use to logging in my sistem.

Thanks JP


If you can't use it for all of them, you can set it for each Class in the individual mapping files.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:08 am 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
HOOOO how can i do this ??? this will help me a lot !!!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:11 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
wladelin wrote:
HOOOO how can i do this ??? this will help me a lot !!!!


<class name="MyClass" schema="myschema">
...
...
</class>

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 11:33 am 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
Guy very, very, very, .... very, thanks this has resolved my trobel !!!!

Im very pleased !!!!


Thanks JP


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