DBunit不导出主键

时间:2019-07-05 15:29:17

标签: java postgresql dbunit

我正在尝试使用dbUnit(V2.6.0)从PostgreSQL(V10.7)导出数据。我可以导出它,但是不会导出我的主键(UUID类型)。如何将它们包括在导出中?

public static void main(String[] args) throws Exception {
    Class.forName("org.postgresql.Driver");

    Connection jdbcConnection = DriverManager.getConnection("xxxxxxxxxxx", "xxxxxxxxxxx", "xxxxxxxxxxx");
    IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
    connection.getConfig().setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true);
    connection.getConfig();


    String[] tableNames = new String[1];
    tableNames[0] = "security.account";
    IDataSet fullDataSet = connection.createDataSet(tableNames);
    FlatXmlDataSet.write(fullDataSet, new FileOutputStream("xxxxxxxxxxx"));
}

出口:

<?xml version='1.0' encoding='UTF-8'?>
<dataset>
   <security.account created="2019-07-05 11:27:49.997" last_updated="2019-07-05 11:27:49.997" archived="false" authentication_type="0"  email="xxxxxxx@xxxxxx.com" locked="false" password="$shiro1$SHA-256$10000$Z5VLfbaIBNhzMPoKecXWvA==$PcmmYr8HZbha19IU3HbObPwJbLdFr/7Wwxs5NoPCsY0=" username="xxxxxxxx"/>
</dataset>

我的数据库结构的一部分:

enter image description here

0 个答案:

没有答案