/** * Creates a row writer factory which maps objects of a given class type to columns in table. * <p/> * The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. */ public static <T> RowWriterFactory<T> mapToRow(Class<T> sourceClass, Pair... columnNameMappings) { return mapToRow(sourceClass, convertToMap(columnNameMappings)); }
/** * Creates a row writer factory which maps objects of a given class type to columns in table. * <p/> * The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. */ public static <T> RowWriterFactory<T> mapToRow(Class<T> sourceClass, Pair... columnNameMappings) { return mapToRow(sourceClass, convertToMap(columnNameMappings)); }
/** * Creates a row writer factory which maps objects of a given class type to columns in table. * <p/> * The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. * @param fieldToColumnNameMappings mapping of field name to column name. */ public static <T> RowWriterFactory<T> mapToRow(Class<T> sourceClass, Pair... fieldToColumnNameMappings) { return mapToRow(sourceClass, convertToMap(fieldToColumnNameMappings)); }
/** * Creates a row writer factory which maps objects of a given class type to columns in table. * <p/> * The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. */ public static <T> RowWriterFactory<T> mapToRow(Class<T> sourceClass, Pair... columnNameMappings) { return mapToRow(sourceClass, convertToMap(columnNameMappings)); }
/** * Creates a row writer factory which maps objects of a given class type to columns in table. * <p/> * The given source class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapToRow(Class, ColumnMapper)} method. * @param fieldToColumnNameMappings mapping of field name to column name. */ public static <T> RowWriterFactory<T> mapToRow(Class<T> sourceClass, Pair... fieldToColumnNameMappings) { return mapToRow(sourceClass, convertToMap(fieldToColumnNameMappings)); }
/** * Constructs a row reader factory which maps an entire row to an object of a specified type. * <p/> * The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static <T> RowReaderFactory<T> mapRowTo(Class<T> targetClass, Pair... columnMappings) { TypeTags.TypeTag<T> tt = typeTag(targetClass); ColumnMapper<T> mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); }
/** * Constructs a row reader factory which maps an entire row to an object of a specified type. * <p/> * The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static <T> RowReaderFactory<T> mapRowTo(Class<T> targetClass, Pair... columnMappings) { TypeTags.TypeTag<T> tt = typeTag(targetClass); ColumnMapper<T> mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); }
/** * Constructs a row reader factory which maps an entire row to an object of a specified type. * <p/> * The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static <T> RowReaderFactory<T> mapRowTo(Class<T> targetClass, Pair... columnMappings) { TypeTags.TypeTag<T> tt = typeTag(targetClass); ColumnMapper<T> mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); }
/** * Constructs a row reader factory which maps an entire row to an object of a specified type. * <p/> * The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static <T> RowReaderFactory<T> mapRowTo(Class<T> targetClass, Pair... columnMappings) { TypeTags.TypeTag<T> tt = typeTag(targetClass); ColumnMapper<T> mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); }
/** * Constructs a row reader factory which maps an entire row to an object of a specified type. * <p/> * The given target class is considered to follow the Java bean style convention. It should have a * public, no-args constructor, as well as a set of getters and setters. The names of the attributes * must follow the names of columns in the table (however, different conventions are allowed - see * the guide for more info). The default mapping of attributes to column names can be changed by * providing a custom map of attribute-column mappings for the pairs which do not follow the general * convention. * <p/> * The method uses {@link JavaBeanColumnMapper} as the column mapper. If another column mapper has to * be used, see {@link #mapRowTo(Class, ColumnMapper)} method. */ public static <T> RowReaderFactory<T> mapRowTo(Class<T> targetClass, Pair... columnMappings) { TypeTags.TypeTag<T> tt = typeTag(targetClass); ColumnMapper<T> mapper = javaBeanColumnMapper(safeClassTag(targetClass), convertToMap(columnMappings)); return new ClassBasedRowReaderFactory<>(tt, mapper); }