@Test public void testSetFieldConfigs() throws SQLException { DatabaseTableConfig<DatabaseTableAnno> dbTableConf = new DatabaseTableConfig<DatabaseTableAnno>(); dbTableConf.setDataClass(DatabaseTableAnno.class); dbTableConf.setTableName(TABLE_NAME); List<DatabaseFieldConfig> fieldConfigs = new ArrayList<DatabaseFieldConfig>(); fieldConfigs.add(new DatabaseFieldConfig("stuff", null, DataType.UNKNOWN, "", 0, true, false, false, null, false, null, false, null, false, null, false, null, null, false, DatabaseFieldConfig.NO_MAX_FOREIGN_AUTO_REFRESH_LEVEL_SPECIFIED, 0)); dbTableConf.setFieldConfigs(fieldConfigs); dbTableConf.initialize(); assertEquals(DatabaseTableAnno.class, dbTableConf.getDataClass()); assertEquals(TABLE_NAME, dbTableConf.getTableName()); dbTableConf.extractFieldTypes(connectionSource); FieldType[] fieldTypes = dbTableConf.getFieldTypes(databaseType); assertEquals(1, fieldTypes.length); assertEquals("stuff", fieldTypes[0].getColumnName()); }
public void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs) { this.fieldConfigs = fieldConfigs; }
DatabaseTableConfig { public void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs) { this.fieldConfigs = fieldConfigs; } }
DatabaseTableConfig { public void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs) { this.fieldConfigs = fieldConfigs; } DatabaseTableConfig();  DatabaseTableConfig(Class<T> dataClass, List<DatabaseFieldConfig> fieldConfigs);  DatabaseTableConfig(Class<T> dataClass, String tableName, List<DatabaseFieldConfig> fieldConfigs); private  DatabaseTableConfig(Class<T> dataClass, String tableName, FieldType[] fieldTypes); }
DatabaseTableConfig { public void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs) { this.fieldConfigs = fieldConfigs; } DatabaseTableConfig();  DatabaseTableConfig(Class<T> dataClass, List<DatabaseFieldConfig> fieldConfigs);  DatabaseTableConfig(Class<T> dataClass, String tableName, List<DatabaseFieldConfig> fieldConfigs); private  DatabaseTableConfig(Class<T> dataClass, String tableName, FieldType[] fieldTypes); void initialize(); Class<T> getDataClass(); void setDataClass(Class<T> dataClass); String getTableName(); void setTableName(String tableName); void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs); void extractFieldTypes(ConnectionSource connectionSource); FieldType[] getFieldTypes(DatabaseType databaseType); List<DatabaseFieldConfig> getFieldConfigs(); Constructor<T> getConstructor(); void setConstructor(Constructor<T> constructor); static DatabaseTableConfig<T> fromClass(ConnectionSource connectionSource, Class<T> clazz); static String extractTableName(Class<T> clazz); static Constructor<T> findNoArgConstructor(Class<T> dataClass); }
DatabaseTableConfig { public void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs) { this.fieldConfigs = fieldConfigs; } DatabaseTableConfig();  DatabaseTableConfig(Class<T> dataClass, List<DatabaseFieldConfig> fieldConfigs);  DatabaseTableConfig(Class<T> dataClass, String tableName, List<DatabaseFieldConfig> fieldConfigs); private  DatabaseTableConfig(Class<T> dataClass, String tableName, FieldType[] fieldTypes); void initialize(); Class<T> getDataClass(); void setDataClass(Class<T> dataClass); String getTableName(); void setTableName(String tableName); void setFieldConfigs(List<DatabaseFieldConfig> fieldConfigs); void extractFieldTypes(ConnectionSource connectionSource); FieldType[] getFieldTypes(DatabaseType databaseType); List<DatabaseFieldConfig> getFieldConfigs(); Constructor<T> getConstructor(); void setConstructor(Constructor<T> constructor); static DatabaseTableConfig<T> fromClass(ConnectionSource connectionSource, Class<T> clazz); static String extractTableName(Class<T> clazz); static Constructor<T> findNoArgConstructor(Class<T> dataClass);  }