-->
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: How to stop generation of fully qualified table name
PostPosted: Mon May 07, 2007 11:25 pm 
Beginner
Beginner

Joined: Mon May 07, 2007 11:12 pm
Posts: 20
Hello,

All of my sql statements being generated by hibernate are being qualified by the schema or database name. Is there anyway to prevent this? I have updated the hibernate maps to exclude this, but they are still being qualified so I am not sure where this information is being set, but i need to prevent this.

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Apr 19, 2007 12:21:40 AM by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping default-lazy="false">
    <class name="diamelle.common.service.ServiceConfig" table="service_config">
        <comment></comment>
        <id name="serviceConfigId" type="string">
            <column name="SERVICE_CONFIG_ID" length="20" />
            <generator class="assigned" />
        </id>
        <many-to-one name="service" class="diamelle.common.service.Service" fetch="select">
            <column name="SERVICE_ID" length="20">
                <comment></comment>
            </column>
        </many-to-one>
        <property name="name" type="string">
            <column name="NAME" length="40">
                <comment></comment>
            </column>
        </property>
        <property name="value" type="string">
            <column name="VALUE" length="40">
                <comment></comment>
            </column>
        </property>
    </class>
</hibernate-mapping>



Resulting Output

Code:
23:23:21,046 INFO  [STDOUT] Hibernate: select servicecon0_.SERVICE_ID as SERVICE
2_1_, servicecon0_.SERVICE_CONFIG_ID as SERVICE1_1_, servicecon0_.SERVICE_CONFIG
_ID as SERVICE1_9_0_, servicecon0_.SERVICE_ID as SERVICE2_9_0_, servicecon0_.NAM
E as NAME9_0_, servicecon0_.VALUE as VALUE9_0_ from [b]mysql.service_config[/b] service
con0_ where servicecon0_.SERVICE_ID=?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 07, 2007 11:41 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Is there a default_schema or default_catalog in your hibernate.cfg.xml file?

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 8:40 am 
Beginner
Beginner

Joined: Mon May 07, 2007 11:12 pm
Posts: 20
No, I dont have defaut schema in the config file. I have pasted it below.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="sessionFactory">

   <!-- Oracle -->
   <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
   <property name="connection.password">idmuser</property>
   <property name="connection.url">jdbc:oracle:thin:@172.17.2.121:1521:orcl</property>
   <property name="connection.username">idmuser</property>
   <property name="dialect">org.hibernate.dialect.Oracle</property>

    <!-- Disable the second-level cache  -->
    <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
    <property name="cache.use_query_cache">false</property>
    <property name="cache.use_minimal_puts">false</property>

    <!-- In eager fetching, only join three tables deep if joins are used -->
    <property name="max_fetch_depth">3</property>

    <!-- Print SQL to stdout, format it nicely  -->
    <property name="show_sql">false</property>
    <property name="format_sql">true</property>
    <property name="use_sql_comments">true</property>


    <!-- Use thread-bound persistence context propagation, scoped to the transaction -->
    <property name="current_session_context_class">thread</property>
   
    <mapping resource="diamelle/common/service/Service.hbm.xml"/>
    <mapping resource="diamelle/common/service/ServiceConfig.hbm.xml"/>
    <mapping resource="diamelle/common/service/RequestForm.hbm.xml"/>
    <mapping resource="diamelle/common/service/RequestApprover.hbm.xml"/>


</session-factory>
</hibernate-configuration>



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.