use of org.jdbi.v3.jpa.internal.JpaClass in project jdbi by jdbi.
the class BindJpaFactory method createForParameter.
@Override
public SqlStatementParameterCustomizer createForParameter(Annotation annotation, Class<?> sqlObjectType, Method method, Parameter param, int index, Type type) {
BindJpa bind = (BindJpa) annotation;
final String prefix;
if (bind.value().isEmpty()) {
prefix = "";
} else {
prefix = bind.value() + ".";
}
return (stmt, arg) -> {
JpaClass<?> jpaClass = JpaClass.get(arg.getClass());
for (JpaMember member : jpaClass.members()) {
stmt.bindByType(prefix + member.getColumnName(), readMember(arg, member), member.getType());
}
};
}
Aggregations