org.hotrod.runtime.livesql.queries.UpdateSetCompletePhase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hotrod-livesql Show documentation
Show all versions of hotrod-livesql Show documentation
HotRod is an ORM for Java, Spring and SpringBoot.
package org.hotrod.runtime.livesql.queries;
import java.util.Map;
import org.hotrod.runtime.livesql.expressions.predicates.Predicate;
import org.hotrod.runtime.livesql.metadata.TableOrView;
public class UpdateSetCompletePhase implements DMLQuery {
// Properties
private LiveSQLContext context;
private UpdateObject update;
// Constructor
public UpdateSetCompletePhase(final LiveSQLContext context, final UpdateObject update) {
this.context = context;
this.update = update;
}
public UpdateSetCompletePhase(final LiveSQLContext context, final String mapperStatement,
final TableOrView tableOrView, final Predicate predicate, final Map extraSets) {
this.context = context;
this.update = new UpdateObject(mapperStatement);
this.update.setTableOrView(tableOrView);
this.update.setWherePredicate(predicate);
this.update.setExtraSets(extraSets);
}
// Current phase
// Next phases
public UpdateWherePhase where(final Predicate predicate) {
return new UpdateWherePhase(this.context, this.update, predicate);
}
// Preview
@Override
public String getPreview() {
return this.update.getPreview(this.context);
}
// Execute
@Override
public void execute() {
this.update.execute(this.context);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy