[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1329?page=c...
]
Yariv Yaari commented on HHH-1329:
----------------------------------
Although adding the VIEW would probably work on most databases, at least as far as vies
are concerned, shouldn't the solution be more general? What about other types of
tables like "Materialized views" in oracle that might be tables of a different
type? Why restrict the user if the object can be treated as a table? In the API of this
method (getTables) It is specified that the fourth parameter (tableTypes) can be null, so
that all types will be returned. Why not pass null?
SchemaValidator fail when views are involved
--------------------------------------------
Key: HHH-1329
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1329
Project: Hibernate3
Issue Type: Bug
Components: metamodel
Affects Versions: 3.1
Environment: database: oracle9i
hibernate: 3.1
jdbc driver: ojdbc14-10.2.0.1.0
Reporter: Yariv Yaari
Assignee: Diego Pires Plentz
All calls in org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata to
java.sql.DatabaseMetaData.getTables set the fourth parameter (types) to
{"TABLE"} (defined as a class-level constant).
In the documentation of getTables it is not defined what are the meanings of the types
passed as parameter, only that all the strings must be in
java.sql.DatabaseMetaData.getTablesTypes return value. In oracle9i with
ojdbc14-10.2.0.1.0.jar views are returned if types contains "VIEW" and not if
its {"TABLE"}. It is a major problem only if hibernate.hbm2ddl.auto is set to
validate, if it's set to update it will log some errors (since it can't create or
alter the table, there is a view with this name) but it won't fail the deployment, and
since in SQL views are treated as tables, there will be no more problems.
It should be checked for more databases/jdbc drivers.
It is not obvious what should be the solution.
Pass {"TABLE","VIEW"} always? Pass them if they are in
getTableTypes?
Put it as part of the dialect, default to {"TABLE"} and change it in
oreacle-dialects?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira