com.kenshoo.pl.entity.InsertOnDuplicateUpdateCommand 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;
public class InsertOnDuplicateUpdateCommand, ID extends Identifier> extends UpdateEntityCommand {
private ChangeOperation changeOperation = ChangeOperation.UPDATE;
private boolean allowMissingEntity = true;
public InsertOnDuplicateUpdateCommand(E entityType, ID key) {
super(entityType, key);
}
@Override
public ChangeOperation getChangeOperation() {
return changeOperation;
}
@Override
public boolean allowMissingEntity() {
return allowMissingEntity;
}
@Override
public void updateOperator(ChangeOperation changeOperation) {
if(this.changeOperation == ChangeOperation.UPDATE && changeOperation == ChangeOperation.CREATE) {
this.changeOperation = changeOperation;
this.allowMissingEntity = false;
ChangeEntityCommand.copy(this, this.getIdentifier());
} else {
throw new UnsupportedOperationException("Unsupported update change operation from " + this.changeOperation + " to " + changeOperation);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy