use of io.requery.proxy.EntityBuilderProxy in project requery by requery.
the class EntityReader method fromBuilder.
final <B> E fromBuilder(ResultSet results, Attribute[] selection) throws SQLException {
EntityBuilderProxy<B, E> proxy = new EntityBuilderProxy<>(type);
int index = 1;
for (Attribute expression : selection) {
@SuppressWarnings("unchecked") Attribute<E, ?> attribute = (Attribute<E, ?>) expression;
if (attribute.getPrimitiveKind() != null) {
readPrimitiveField(proxy, attribute, results, index);
} else {
Object value = mapping.read((Expression) attribute, results, index);
proxy.setObject(attribute, value, PropertyState.LOADED);
}
index++;
}
return proxy.build();
}
Aggregations