-->
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.  [ 4 posts ] 
Author Message
 Post subject: hibernate.hbm2ddl.auto=validate
PostPosted: Thu Nov 04, 2010 4:13 pm 
Newbie

Joined: Thu Nov 04, 2010 3:58 pm
Posts: 2
Hello,

I am using oracle synonym with hibernate. I have set up database meta data properties hibernate.hbm2ddl.auto=validate.

Synonym is specified as
@Entity
@Table(name = "S_Foo", schema = "Foo_Schema")

I am getting following error:

org.hibernate.HibernateException: Missing table: S_Foo

Does anybody encounter similiar issue?

It seems that org.hibernate.tool.hbm2ddl.DatabaseMetadata class only allows type TABLE and VIEW.

Does anybody found solution to use sysnonym with hibernate?


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto=validate
PostPosted: Thu Nov 04, 2010 6:38 pm 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
Remove the following line from your configuration at all:

Code:
hibernate.hbm2ddl.auto=validate


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto=validate
PostPosted: Fri Nov 05, 2010 9:07 am 
Newbie

Joined: Thu Nov 04, 2010 3:58 pm
Posts: 2
I am aware of this workaround. But we skip schema validation.

The problem is in hibernates org.hibernate.tool.hbm2ddl.DatabaseMetadata class where the table types are hardcoded to

private static final String[] TYPES = {"TABLE", "VIEW"}; where it really should be

private static final String[] TYPES = {"TABLE", "VIEW", "ALIAS", "SYNONYM"};

Does anybody try this and patch hibernate?


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto=validate
PostPosted: Fri Nov 05, 2010 11:12 am 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
You can patch Hibernate yourself. It is open source product.

Why do you need schema validation at all? In most cases it will just eat time and resource giving no real gain.


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