-->
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: NHibernate default_schema property
PostPosted: Wed Aug 15, 2007 3:47 pm 
Newbie

Joined: Wed Aug 15, 2007 3:39 pm
Posts: 1
NHibernate version: 1.2.0

When omitting the schema attribute in mapping files and using default_shema property in the NHibernate configuration, generated SQL statements are not qualified using the schema name.
Code:
<?xml version="1.0" encoding="utf-8" ?>
  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="dialect">NHibernate.Dialect.OracleDialect</property>
      <property name="default_schema">DOCREPO_DEV1</property>
      <property name="show_sql">true</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
      <property name="connection.connection_string"><![CDATA[user ID=epsilon;Password=epsilon;Data Source=QA10G.INTEGRIM.COM]]></property>
      <mapping assembly="ClinCaptDocRepo" />
    </session-factory>
  </hibernate-configuration>


Any suggestions?


Top
 Profile  
 
 Post subject: NHibernate default_schema property
PostPosted: Wed Feb 20, 2008 4:23 am 
Newbie

Joined: Wed Feb 20, 2008 4:16 am
Posts: 2
I'm having the exact same problem over here. When I view the queries that are being send to SQL server (through SQL profiler) I see no difference in the query.

Somebody got a solution?


Top
 Profile  
 
 Post subject: Found the solution!
PostPosted: Wed Feb 20, 2008 7:00 am 
Newbie

Joined: Wed Feb 20, 2008 4:16 am
Posts: 2
I have found the solution and I want to share it with you:

take a look in your table mapping files (*.hbm.xml), properly the second line of the mapping file contains the hibernate-mapping tag, check if there is a 'schema=??' attribute. Remove it from the mapping file and your query will be adjusted with the default_schema option that you have configurered.


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.