-
Bug
-
Resolution: Done
-
Major
-
4.2.0.GA_CP02, 4.2.0.GA_CP03
-
None
-
Release Notes
We want to map an EJB entity to a database view (using Oracle 10g) in order to address a problem in Production without making a coding change. However, when we start up JBoss, we get a validation error, "Cannot find table ...". We are using the out-of-the-box version of Hibernate (3.2.4-sp1) and have found the problem to be Line 49 of org.hibernate.tool.hbm2ddl.DatabaseMetadata
private static final String[] TYPES =
{"TABLE"};
is the problem. This gets passed into java.sql.DatabaseMetadata.getTables(catalog, schema, tableName, TYPES);
our implementation of java.sql.DatabaseMetadata is orable.jdbc.driver.OracleDatabaseMetaData
If you pass in
{"TABLE", "VIEW"} then the method returns the correct value... but with the hard coded "TABLE" it does not.The following code returns the info about the table... adding "VIEW" makes it work
public static void main(String[] args) throws Exception {
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:aquina/testbed11@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=endevdb02.enernoc.net)(PORT=1521))(FAILOVER=on)(LOAD_BALANCE=on)(CONNECT_DATA=(SERVICE_NAME=fusdev)))");
OracleDatabaseMetaData meta = new OracleDatabaseMetaData((OracleConnection)conn);
String[] TYPES = {"TABLE", "VIEW"}
;
ResultSet rs = meta.getTables("", "AQUINA", "ACTION_UNIT_VIEW", TYPES);
if (rs.next())
}
We have noted that this has in fact changed in the latest version of Hibernate (3.3.1.GA).
- is incorporated by
-
JBPAPP-1214 Upgrade Hibernate to 3.2.4.SP1_CP06
- Resolved