com.kenshoo.pl.entity.spi.helpers.CopyFieldsOnUpdateEnricher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity.spi.helpers;
import com.kenshoo.pl.entity.EntityField;
import com.kenshoo.pl.entity.EntityType;
import com.kenshoo.pl.entity.SupportedChangeOperation;
public class CopyFieldsOnUpdateEnricher> extends CopyFieldsOnCreateEnricher {
public CopyFieldsOnUpdateEnricher(EntityField, T1> sourceField1, EntityField targetField1,
EntityField, T2> sourceField2, EntityField targetField2) {
super(sourceField1,targetField1,sourceField2,targetField2);
}
@Override
protected void addRequiredFields() {
super.addRequiredFields();
this.fields2Copy.stream()
.map(Field2Copy::getTarget)
.forEach(requiredFields::add);
}
@Override
public SupportedChangeOperation getSupportedChangeOperation() {
return SupportedChangeOperation.UPDATE;
}
}