private void updateChargePointInternal(DSLContext ctx, ChargePointForm form, Integer addressPk) { ctx.update(CHARGE_BOX) .set(CHARGE_BOX.DESCRIPTION, form.getDescription()) .set(CHARGE_BOX.LOCATION_LATITUDE, form.getLocationLatitude()) .set(CHARGE_BOX.LOCATION_LONGITUDE, form.getLocationLongitude()) .set(CHARGE_BOX.NOTE, form.getNote()) .set(CHARGE_BOX.ADDRESS_PK, addressPk) .where(CHARGE_BOX.CHARGE_BOX_PK.equal(form.getChargeBoxPk())) .execute(); }
private int addChargePointInternal(DSLContext ctx, ChargePointForm form, Integer addressPk) { return ctx.insertInto(CHARGE_BOX) .set(CHARGE_BOX.CHARGE_BOX_ID, form.getChargeBoxId()) .set(CHARGE_BOX.DESCRIPTION, form.getDescription()) .set(CHARGE_BOX.LOCATION_LATITUDE, form.getLocationLatitude()) .set(CHARGE_BOX.LOCATION_LONGITUDE, form.getLocationLongitude()) .set(CHARGE_BOX.NOTE, form.getNote()) .set(CHARGE_BOX.ADDRESS_PK, addressPk) .returning(CHARGE_BOX.CHARGE_BOX_PK) .fetchOne() .getChargeBoxPk(); }