-->
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: Validation against the same table name in different schemas
PostPosted: Wed Jul 17, 2013 10:21 am 
Newbie

Joined: Wed Jul 17, 2013 10:12 am
Posts: 1
Hello,

Description: When a table does exist in different schemas with the same table name (but e.g. different columns) on the same (oracle) database the schema validation of hibernate does not make sure that the validation is executed against the correct "schema.table". Instead, it takes the first table in the list of metadata tables with the given name regardless of the schema it resides in and validates it against the java entity.

Problem: The order of tables in that list is determined by the creation time. Hence, if the table against which the validation shall not occur, is further up the list the validation is executed against the wrong table.

Possible "Solutions":
  • If the table against which the validation shall not occur is dropped and recreated it is further down in the list and will not be used for validation since the "correct" table now is further up and used. => Not a practical solution since it involves manual dropping and creating tables.
  • Turn off validation. => Not a real solution since we need the validation.
  • Use schema attribute of javax.persistence.Table in the java entity to specify the schema of the table or specify a default schema to be used for all tables. However, the reason to have the same table in different schemas is that every developer has its own schema. So each developer would need his own version of tables / configuration. => Not a practical solution.

Is that issue known? Is there a solution in hibernate (other than the above mentioned or using different names for tables in each schema)?

Regards,

Ballone


Top
 Profile  
 
 Post subject: Re: Validation against the same table name in different schemas
PostPosted: Fri Feb 24, 2017 9:27 am 
Newbie

Joined: Wed Dec 21, 2016 4:22 am
Posts: 2
I found same problem.

I happen to have two databases with same table names, and validation was executed on wrong schema. Was able to solve only by one of databases deletion (drop). Though this a problem on production server, where we have few databases with same table names.

Is it validation bug?


Top
 Profile  
 
 Post subject: Re: Validation against the same table name in different schemas
PostPosted: Fri Feb 24, 2017 12:39 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You should open a Jira issue and provide a replicating test case.


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.