public interface ChangeContext extends Context
BatchUpdateOp.updateChange(com.google.gerrit.server.update.ChangeContext) phase.
A single ChangeContext corresponds to updating a single change; if a BatchUpdate spans multiple changes, then multiple ChangeContext instances will be
created.
| Modifier and Type | Method and Description |
|---|---|
void |
bumpLastUpdatedOn(boolean bump) |
void |
deleteChange()
Instruct
BatchUpdate to delete this change. |
default Change |
getChange() |
ChangeControl |
getControl() |
default ChangeNotes |
getNotes() |
ChangeUpdate |
getUpdate(PatchSet.Id psId)
Get an update for this change at a given patch set.
|
getAccount, getAccountId, getDb, getIdentifiedUser, getOrder, getProject, getRepository, getRevWalk, getTimeZone, getUser, getWhenChangeUpdate getUpdate(PatchSet.Id psId)
A single operation can modify changes at different patch sets. Commits in the NoteDb graph within this update are created in patch set order.
To get the current patch set ID, use PatchSetUtil.current(com.google.gerrit.reviewdb.server.ReviewDb, com.google.gerrit.server.notedb.ChangeNotes).
psId - patch set ID.ChangeControl getControl()
Context.getUser(), and the
change data is read within the same transaction that updateChange is executing.void bumpLastUpdatedOn(boolean bump)
bump - whether to bump the value of Change.getLastUpdatedOn() field before storing
to ReviewDb. For NoteDb, the value is always incremented (assuming the update is not
otherwise a no-op).void deleteChange()
BatchUpdate to delete this change.
If called, all other updates are ignored.
default ChangeNotes getNotes()
getControl().default Change getChange()
getControl().