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.  [ 1 post ] 
Author Message
 Post subject: Mapping an Oracle synonym
PostPosted: Fri Jul 02, 2010 4:31 am 
Newbie

Joined: Tue Feb 23, 2010 9:59 am
Posts: 4
Hi Everyone,

It seems my problem is trivial, but i'm in a dead-end…

My application connects to a table through a synonym, here is what i have :
Synonym : MY_USER.MY_SYNONYM
Target object : USER_PROD.MY_TABLE.

But for persistance tests, i have an another table in the same schema 'USER_PROD' :
Synonym : MY_USER_TEST.MY_SYNONYM
Target object : USER_PROD.MY_TABLE_TEST

The two synonyms are differents but have the same names to doesn't have to change Hibernate mapping.
Code:
<hibernate-mapping>
    <class name="com.bla.tableVO"
        table="MY_SYNONYM" >
...
    </class>
</hibernate-mapping>



Unfortunatly, during tests i can't connect to my test Synonym, the message is :
Code:
...
09:48:07,396 INFO  [SchemaValidator] (main:) Running schema validator
09:48:07,396 INFO  [SchemaValidator] (main:) fetching database metadata
09:48:07,677 INFO  [DatabaseMetadata] (main:) table not found: MY_SYNONYM
...


But, in the mapping file, if i change the name of the synonym by the name of the target table, the connection works well.
I read everywhere that it was transparent to Hibernate to map a table, a synonym or a view.

Does anyone know why my synonym is not found ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.