[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1329) SchemaValidator skips views on Oracle

Diego Pires Plentz (JIRA) noreply at atlassian.com
Sun Sep 23 12:20:14 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28160 ] 

Diego Pires Plentz commented on HHH-1329:
-----------------------------------------

I think that passing {"TABLE","VIEW"} always, will solve this issue, since the javadocs

http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[])

say:
TABLE_TYPE String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".

> SchemaValidator skips views on Oracle
> -------------------------------------
>
>                 Key: HHH-1329
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1329
>             Project: Hibernate3
>          Issue Type: Improvement
>          Components: metamodel
>    Affects Versions: 3.1
>         Environment: database: oracle9i
> hibernate: 3.1
> jdbc driver: ojdbc14-10.2.0.1.0
>            Reporter: Yariv Yaari
>
> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list