/** * Associate the specified FieldMapper for the specified property. * @param key the property * @param fieldMapper the fieldMapper * @return the current factory */ public JdbcMapperFactory addCustomFieldMapper(String key, FieldMapper<ResultSet, ?> fieldMapper) { return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>customFieldMapperDefinition(fieldMapper)); }
/** * Associate the specified Getter for the specified property. * @param key the property * @param getter the getter * @return the current factory */ public JdbcMapperFactory addCustomGetter(String key, Getter<ResultSet, ?> getter) { return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>customGetter(getter)); }
/** * Associate the specified FieldMapper for the specified property. * @param key the property * @param fieldMapper the fieldMapper * @return the current factory */ public JdbcMapperFactory addCustomFieldMapper(String key, FieldMapper<ResultSet, ?> fieldMapper) { return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>customFieldMapperDefinition(fieldMapper)); }
/** * Associate the specified Getter for the specified property. * @param key the property * @param getter the getter * @return the current factory */ public JdbcMapperFactory addCustomGetter(String key, Getter<ResultSet, ?> getter) { return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>customGetter(getter)); }
/** * Create a discriminator builder based on the specified property * @param column the discriminator property * @param <T> the root type of the jdbcMapper * @return a builder to specify the type mapping */ public <T> DiscriminatorJdbcBuilder<T> newDiscriminator(String column) { ignorePropertyNotFound(); addColumnDefinition(column, FieldMapperColumnDefinition.<JdbcColumnKey>ignoreDefinition()); return new DiscriminatorJdbcBuilder<T>(column, this); }
/** * Create a discriminator builder based on the specified property * @param column the discriminator property * @param <T> the root type of the jdbcMapper * @return a builder to specify the type mapping */ public <T> DiscriminatorJdbcBuilder<T> newDiscriminator(String column) { ignorePropertyNotFound(); addColumnDefinition(column, FieldMapperColumnDefinition.<JdbcColumnKey>ignoreDefinition()); return new DiscriminatorJdbcBuilder<T>(column, this); }
@Test public void test() throws SQLException { JdbcMapper<Person> mapper = JdbcMapperFactory.newInstance() .addColumnDefinition( new Predicate<JdbcColumnKey>() { @Override