com.github.longdt.vertxorm.repository.RowMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-orm-postgresql Show documentation
Show all versions of vertx-orm-postgresql Show documentation
A simple library which provide POJO mapping Table utilities
package com.github.longdt.vertxorm.repository;
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.longdt.vertxorm.repository.base.BuilderImpl;
import io.vertx.core.json.JsonObject;
import io.vertx.sqlclient.Row;
import java.math.BigDecimal;
import java.util.UUID;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
public interface RowMapper {
static Builder builder(String tableName, Supplier supplier) {
return new BuilderImpl<>(tableName, supplier);
}
E map(Row row);
interface Builder {
Builder pk(String pkName, Function pkGetter, BiConsumer pkSetter);
Builder pk(String pkName, Function pkGetter, BiConsumer pkSetter, boolean autogen);
Builder pkConverter(Function pkGetConverter, Function pkSetConverter);
Builder addField(String fieldName, Function super E, T> getter, BiConsumer super E, T> setter);
Builder addField(String fieldName, Function super E, T> getter, BiConsumer super E, T> setter, Function getConverter, Function setConverter);
Builder addUuidField(String fieldName, Function getter, BiConsumer setter);
Builder addJsonField(String fieldName, Function getter, BiConsumer setter, Class clazz);
Builder addJsonField(String fieldName, Function getter, BiConsumer setter, TypeReference type);
Builder addDecimalField(String fieldName, Function getter, BiConsumer setter);
Builder addJsonObjectField(String fieldName, Function getter, BiConsumer setter);
RowMapper build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy