private ENTITY update(ENTITY entity, Predicate<Field<ENTITY>> includedFields, String updateStatement) throws SpeedmentException { final List<Object> values = Stream.concat( fields.get().filter(includedFields), primaryKeyFields.get() ) .map(f -> toDatabaseType(f, entity)) .collect(Collectors.toList()); try { operationHandler.executeUpdate(dbms, updateStatement, values); return entity; } catch (final SQLException ex) { throw new SpeedmentException(ex); } }
@Override public ENTITY update(ENTITY entity) throws SpeedmentException { assertHasPrimaryKeyColumns(); final List<Object> values = Stream.concat( fields.get().filter(f -> updateColumnFilter.test(columnsByFields.get(f))), primaryKeyFields.get() ) .map(f -> toDatabaseType(f, entity)) .collect(Collectors.toList()); try { operationHandler.executeUpdate(dbms, updateStatement, values); return entity; } catch (final SQLException ex) { throw new SpeedmentException(ex); } }
private ENTITY update(ENTITY entity, Predicate<Field<ENTITY>> includedFields, String updateStatement) throws SpeedmentException { final List<Object> values = Stream.concat( fields.get().filter(includedFields), primaryKeyFields.get() ) .map(f -> toDatabaseType(f, entity)) .collect(Collectors.toList()); try { operationHandler.executeUpdate(dbms, updateStatement, values); return entity; } catch (final SQLException ex) { throw new SpeedmentException(ex); } }
@Override public ENTITY update(ENTITY entity) throws SpeedmentException { assertHasPrimaryKeyColumns(); final List<Object> values = Stream.concat( fields.get().filter(f -> updateColumnFilter.test(columnsByFields.get(f))), primaryKeyFields.get() ) .map(f -> toDatabaseType(f, entity)) .collect(Collectors.toList()); try { operationHandler.executeUpdate(dbms, updateStatement, values); return entity; } catch (final SQLException ex) { throw new SpeedmentException(ex); } }