Hi, we are using Hibernate's schema validation feature in our testcases (Database: Oracle 10i) and have a big problem: Hibernate checks sometimes tables of other user too.
Setup:
We have a user which has access to all schema's. The user was created with following statements:
Code:
drop user cruisecontrol_test cascade;
create user cruisecontrol_test identified by cruisecontrol_test default tablespace users;
commit;
Grant connect, dba, imp_full_database, resource, unlimited tablespace to cruisecontrol_test identified by cruisecontrol_test;
The persistence.xml looks like this:
Code:
<persistence>
<persistence-unit name="myPersistenceUnit">
...
<property name="hibernate.connection.username">
cruisecontrol_test
</property>
<property name="hibernate.connection.password">
cruisecontrol_test
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.OracleDialect
</property>
...
</persistence-unit>
</persistence>
We have an entity MyEntity which is mapped to the table cruisecontrol_test.MY_TABLE. Until now, hibernate has only checked this table. But today, hibernate checked the table an_other_schema.MY_TABLE. Because the table has a wrong structure, hibernate threw an error.
My question is: Why does hibernate check the tables of the other schema and not only the tables for the schema cruisecontrol_test?