@ProviderType
public interface CTManager
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<CTEntryAggregate> |
addRelatedCTEntry(long userId,
CTEntry ownerCTEntry,
CTEntry relatedCTEntry)
Puts a model change to a change entry aggregate associated with the owner
model change.
|
java.util.Optional<CTEntryAggregate> |
addRelatedCTEntry(long userId,
CTEntry ownerCTEntry,
CTEntry relatedCTEntry,
boolean force)
Puts a model change to a change entry aggregate associated with the owner
model change.
|
java.util.Optional<CTEntryAggregate> |
addRelatedCTEntry(long userId,
long ownerCTEntryId,
long relatedCTEntryId)
Puts a model change to a change entry aggregate associated with the owner
model change.
|
<T> T |
executeModelUpdate(com.liferay.petra.function.UnsafeSupplier<T,com.liferay.portal.kernel.exception.PortalException> modelUpdateSupplier)
Executes a model addition or update using the given supplier, with
setting and un-setting the flag that indicates the update before and
after the operation.
|
java.util.Optional<CTEntry> |
getActiveCTCollectionCTEntryOptional(long userId,
long modelClassNameId,
long modelClassPK)
Retrieves a model change in the context of the current user's active
change collection.
|
java.util.Optional<CTCollection> |
getActiveCTCollectionOptional(long userId)
Returns the active change tracking collection associated with the given
user in the scope of the given company.
|
java.util.Optional<CTEntryAggregate> |
getCTEntryAggregateOptional(CTEntry ctEntry,
CTCollection ctCollection)
Returns the change entry aggregate containing the given change entry and
associated with the given change entry collection.
|
java.util.Optional<CTEntry> |
getLatestModelChangeCTEntryOptional(long userId,
long modelResourcePrimKey)
Retrieves the latest model change in the context of the current user's
active change collection.
|
java.util.List<CTEntry> |
getModelChangeCTEntries(long userId,
long modelResourcePrimKey)
Retrieves all model changes in the context of the current user's active
change collection.
|
java.util.List<CTEntry> |
getModelChangeCTEntries(long userId,
long modelResourcePrimKey,
com.liferay.portal.kernel.dao.orm.QueryDefinition<CTEntry> queryDefinition)
Retrieves a paginated and ordered list of all model changes in the
context of the current user's active change collection.
|
java.util.Optional<CTEntryAggregate> |
getModelChangeCTEntryAggregateOptional(long userId,
long modelClassNameId,
long modelClassPK)
Retrieves a model change's bag, first looking for it in the current
user's active change collection, and if it doesn't exist, looking for it
in the production change collection
|
java.util.Optional<CTEntry> |
getModelChangeCTEntryOptional(long userId,
long modelClassNameId,
long modelClassPK)
Retrieves a model change, first looking for it in the current user's
active change collection, and if it doesn't exist, looking for it in the
production change collection
|
java.util.Optional<CTEntry> |
getProductionCTCollectionCTEntryOptional(long userId,
long modelClassNameId,
long modelClassPK)
Retrieves a model change from the production change collection.
|
java.util.List<CTEntry> |
getRelatedCTEntries(CTEntry ctEntry,
CTCollection ctCollection)
Returns the list of change related change entries associated with the
given change entry collection.
|
boolean |
isModelUpdateInProgress()
Indicates whether an add or update is in progress for a model.
|
java.util.Optional<CTEntry> |
registerModelChange(long userId,
long modelClassNameId,
long modelClassPK,
long modelResourcePrimKey,
int changeType)
Registers a model change into the change tracking framework in the
context of the current user's active change collection.
|
java.util.Optional<CTEntry> |
registerModelChange(long userId,
long modelClassNameId,
long modelClassPK,
long modelResourcePrimKey,
int changeType,
boolean force)
Registers a model change into the change tracking framework in the
context of the current user's active change collection.
|
<V extends com.liferay.portal.kernel.model.BaseModel> |
registerRelatedChanges(long userId,
long classNameId,
long classPK)
Puts all related model changes to a change entry aggregate associated
with the owner model change.
|
<V extends com.liferay.portal.kernel.model.BaseModel> |
registerRelatedChanges(long userId,
long classNameId,
long classPK,
boolean force)
Puts all related model changes to a change entry aggregate associated
with the owner model change.
|
java.util.Optional<CTEntry> |
unregisterModelChange(long userId,
long modelClassNameId,
long modelClassPK)
Unregisters a model change from the change tracking framework.
|
java.util.Optional<CTEntryAggregate> addRelatedCTEntry(long userId, CTEntry ownerCTEntry, CTEntry relatedCTEntry)
userId - the primary key of the userownerCTEntry - the owner of the change bagrelatedCTEntry - the change to add to the bagjava.util.Optional<CTEntryAggregate> addRelatedCTEntry(long userId, CTEntry ownerCTEntry, CTEntry relatedCTEntry, boolean force)
force attribute is true.userId - the primary key of the userownerCTEntry - the owner of the change bagrelatedCTEntry - the change to add to the bagforce - forces to override existing change entry in aggregatejava.util.Optional<CTEntryAggregate> addRelatedCTEntry(long userId, long ownerCTEntryId, long relatedCTEntryId)
userId - the primary key of the userownerCTEntryId - the primary key of the owner of the change bagrelatedCTEntryId - the primary key of the change to add to the bag<T> T executeModelUpdate(com.liferay.petra.function.UnsafeSupplier<T,com.liferay.portal.kernel.exception.PortalException> modelUpdateSupplier)
throws com.liferay.portal.kernel.exception.PortalException
isModelUpdateInProgress() will return true.modelUpdateSupplier - The supplier that performs the add or update
and supplies the resulting modelcom.liferay.portal.kernel.exception.PortalExceptionjava.util.Optional<CTEntry> getActiveCTCollectionCTEntryOptional(long userId, long modelClassNameId, long modelClassPK)
userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modeljava.util.Optional<CTCollection> getActiveCTCollectionOptional(long userId)
userId - the primary key of the userjava.util.Optional<CTEntryAggregate> getCTEntryAggregateOptional(CTEntry ctEntry, CTCollection ctCollection)
ctEntry - a model change entryctCollection - a model change entry collectionjava.util.Optional<CTEntry> getLatestModelChangeCTEntryOptional(long userId, long modelResourcePrimKey)
userId - the primary key of the usermodelResourcePrimKey - the primary key of the changed resource
modeljava.util.List<CTEntry> getModelChangeCTEntries(long userId, long modelResourcePrimKey)
userId - the primary key of the usermodelResourcePrimKey - the primary key of the changed resource
modeljava.util.List<CTEntry> getModelChangeCTEntries(long userId, long modelResourcePrimKey, com.liferay.portal.kernel.dao.orm.QueryDefinition<CTEntry> queryDefinition)
userId - the primary key of the usermodelResourcePrimKey - the primary key of the changed resource
modelqueryDefinition - the object contains settings regarding
pagination, order and filterjava.util.Optional<CTEntryAggregate> getModelChangeCTEntryAggregateOptional(long userId, long modelClassNameId, long modelClassPK)
userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modeljava.util.Optional<CTEntry> getModelChangeCTEntryOptional(long userId, long modelClassNameId, long modelClassPK)
userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modeljava.util.Optional<CTEntry> getProductionCTCollectionCTEntryOptional(long userId, long modelClassNameId, long modelClassPK)
userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modeljava.util.List<CTEntry> getRelatedCTEntries(CTEntry ctEntry, CTCollection ctCollection)
ctEntry - a model change entryctCollection - a model change entry collectionboolean isModelUpdateInProgress()
true if the add or update is being executed with
executeModelUpdate(UnsafeSupplier) and the execution is in
progress. Useful to be able to bypass change tracking consideration when
a get or fetch is executed for a model during it's own addition or
update.true if an add or update is in progress for a model
using executeModelUpdate(UnsafeSupplier)java.util.Optional<CTEntry> registerModelChange(long userId, long modelClassNameId, long modelClassPK, long modelResourcePrimKey, int changeType) throws CTException
DuplicateCTEntryException if a change tracking entry already
exists with the same modelClassNameId and
modelClassPK.userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modelmodelResourcePrimKey - the primary key of the changed resource
modelchangeType - the type of the model changeCTExceptionjava.util.Optional<CTEntry> registerModelChange(long userId, long modelClassNameId, long modelClassPK, long modelResourcePrimKey, int changeType, boolean force) throws CTException
DuplicateCTEntryException if a change tracking entry already
exists with the same modelClassNameId and
modelClassPK, except when the force attribute
is true.userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version modelmodelResourcePrimKey - the primary key of the changed resource
modelchangeType - the type of the model changeforce - forces to override an existing change entryCTException<V extends com.liferay.portal.kernel.model.BaseModel> void registerRelatedChanges(long userId,
long classNameId,
long classPK)
userId - the primary key of the userclassNameId - the primary key of the owner version model's classclassPK - the primary key of the owner version model<V extends com.liferay.portal.kernel.model.BaseModel> void registerRelatedChanges(long userId,
long classNameId,
long classPK,
boolean force)
force
attribute is true.userId - the primary key of the userclassNameId - the primary key of the owner version model's classclassPK - the primary key of the owner version modelforce - forces to override existing change entry in aggregatejava.util.Optional<CTEntry> unregisterModelChange(long userId, long modelClassNameId, long modelClassPK)
userId - the primary key of the usermodelClassNameId - the primary key of the changed version model's
classmodelClassPK - the primary key of the changed version model