forked from p81075629/datagear
修复AbstractDevotedDBMetaResolver.getColumns(Connection,String)方法的一个BUG,此BUG可能导致数据导入/导出等相关功能出错
This commit is contained in:
parent
9f7d3b2833
commit
0bf44a63c0
|
@ -165,7 +165,7 @@ public abstract class AbstractDevotedDBMetaResolver extends JdbcSupport implemen
|
|||
DatabaseMetaData metaData = getDatabaseMetaData(cn);
|
||||
String schema = getSchema(cn, metaData);
|
||||
|
||||
return getColumns(cn, metaData, schema, catalog, tableName, null);
|
||||
return getColumns(cn, metaData, catalog, schema, tableName, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,7 @@ import static org.hamcrest.collection.ArrayMatching.arrayContaining;
|
|||
import static org.hamcrest.collection.ArrayMatching.hasItemInArray;
|
||||
import static org.hamcrest.core.IsIterableContaining.hasItem;
|
||||
import static org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
@ -78,4 +79,16 @@ public class GenericDBMetaResolverTest extends DBTestSupport
|
|||
hasItemInArray(hasProperty("columnNames", arrayContaining(equalToIgnoringCase("ACCOUNT_ID")))));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getColumnsTest() throws Exception
|
||||
{
|
||||
Column[] columns = this.genericDBMetaResolver.getColumns(this.connection, "T_ACCOUNT");
|
||||
|
||||
assertEquals(4, columns.length);
|
||||
assertThat(columns[0].getName(), equalToIgnoringCase("ID"));
|
||||
assertThat(columns[1].getName(), equalToIgnoringCase("NAME"));
|
||||
assertThat(columns[2].getName(), equalToIgnoringCase("HEAD_IMG"));
|
||||
assertThat(columns[3].getName(), equalToIgnoringCase("INTRODUCTION"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue