Author: max.andersen(a)jboss.com
Date: 2007-01-09 06:19:00 -0500 (Tue, 09 Jan 2007)
New Revision: 11028
Modified:
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DefaultSchemaCatalogTest.java
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenerateFromJDBCTest.java
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test.java
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3Test.java
Log:
Modified:
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DefaultSchemaCatalogTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DefaultSchemaCatalogTest.java 2007-01-09
11:17:39 UTC (rev 11027)
+++
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/DefaultSchemaCatalogTest.java 2007-01-09
11:19:00 UTC (rev 11028)
@@ -121,7 +121,7 @@
protected String[] getCreateSQL() {
return new String[] {
- "create schema ovrtest AUTHORIZATION SA ",
+ "create schema ovrtest AUTHORIZATION DBA ",
"create table ovrtest.catmaster ( id char not null, name varchar(20), primary
key (id) )",
"create table ovrtest.catchild ( childid char not null, masterref char, primary
key (childid), foreign key (masterref) references catmaster(id) )",
"create table master ( id char not null, name varchar(20), primary key (id)
)",
Modified:
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenerateFromJDBCTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenerateFromJDBCTest.java 2007-01-09
11:17:39 UTC (rev 11027)
+++
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/GenerateFromJDBCTest.java 2007-01-09
11:19:00 UTC (rev 11028)
@@ -5,6 +5,11 @@
package org.hibernate.tool.hbm2x;
import java.io.File;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
import java.util.Iterator;
import org.dom4j.Document;
@@ -57,7 +62,22 @@
cfg2configure.setReverseEngineeringStrategy(configurableNamingStrategy);
}
- public void testGenerateJava() {
+ public void testGenerateJava() throws SQLException, ClassNotFoundException {
+
+ Class.forName("org.h2.Driver");
+ Connection conn = DriverManager.getConnection("jdbc:h2:mem:", "sa",
"");
+ conn.createStatement().execute("CREATE TABLE IF NOT EXISTS TEST(ID INT)");
+ DatabaseMetaData meta = conn.getMetaData();
+ ResultSet rs = meta.getTables(null, null, "TEST", null);
+ while(rs.next()) {
+ String cat = rs.getString("TABLE_CAT");
+ String schema = rs.getString("TABLE_SCHEM");
+ String table = rs.getString("TABLE_NAME");
+ ResultSet rs2 = meta.getColumns(cat, schema, table, null);
+ while(rs2.next()) {
+ System.out.println(table + "." +
rs2.getString("COLUMN_NAME"));
+ }
+ }
POJOExporter exporter = new POJOExporter(cfg,getOutputDir());
exporter.start();
Modified:
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test.java
===================================================================
---
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test.java 2007-01-09
11:17:39 UTC (rev 11027)
+++
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test.java 2007-01-09
11:19:00 UTC (rev 11028)
@@ -220,13 +220,10 @@
}
- protected void tearDown() throws Exception {
-
- //super.tearDown();
- }
+
protected String getBaseForMappings() {
return "org/hibernate/tool/hbm2x/";
}
Modified:
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3Test.java
===================================================================
---
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3Test.java 2007-01-09
11:17:39 UTC (rev 11027)
+++
branches/Branch_3_2/HibernateExt/tools/src/test/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3Test.java 2007-01-09
11:19:00 UTC (rev 11028)
@@ -53,10 +53,6 @@
}
- protected void tearDown() throws Exception {
-
- //super.tearDown();
- }
protected String getBaseForMappings() {
Show replies by date