Class CollectingEntityListener

java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingEntityListener
All Implemented Interfaces:
ContextListener, EntityFacadeListener, CommitListener, EventListener
Direct Known Subclasses:
AbsenceReportAllottedEntityListener, AbstractContactCreateListener, AccountEntityListener, ActiveVatRateEntityListener, AddressDebitorInformationEntityListener, AliasNormalizerEntityListener, ArchivedUserEntityListener, ArticlePriceSortingEntityListener, AvailabilityCalendarFieldsListener, BatchJobEntityListener, BillingPositionCheckEntityListener, BillingPositionEntityCheckEntityListener, BirthdateSortingEntityListener, CalculateActualPointsEntityListener, CalculateAmountEntityListener, CalculateMaxPointsEntityListener, CalculateNumberOfReservationsEntityListener, CalendarEventLabelUpdateListener, CampaignActualValuesEntityListener, CampaignEffortEntityListener, CaseBillingPositionEntityListener, ChildFunctionListener, ClearGeoLocationListener, ClientCacheInvalidationListener, ContactAddressEntityListener, ContactAllUsersListener, ContractCreateEntityListener, ContractDateDeleteEntityListener, ContractValidityDateEntityListener, CopyBillingPositionEntityListener, CopyDocumentsToEntityDocsListener, CopyEducationalSchedulesToEventListener, CopyPathEntityListener, CorrespondenceContactUpdateEntityListener, CostCenterEntityListener, CountEntitiesListener, CourseOfStudyEntityListener, CreateCalendarExportListener, CreateEvaluationAnswersEntityListener, CreateOnlinepaymentOrderListener, CreditRatingEntityListener, CustomerContractBillingPositionEntityListener, DeactivateEntityListener, DebitorCreationEntityListener, DefaultReportRecipientFlagEntityListener, DefaultUserInvoicedEntityListener, DeleteMovementEntityListener, DeleteMovementWithArticleEntityListener, DonationContactEntityListener, EffortFieldUpdateEntityListener, EffortProjectionEntityListener, EffortTimereportEntityListener, EmailArchiveTypeEntityListener, EnsureNoVoucherForFinancialYearEntityListener, EntityCalendarEventListener, EntityDocumentsPropagateRelationEntityListener, EntityHistoryDeletionEntityListener, EntityTemplateCreateEntityListener, EvaluationEntityListener, EventCancellationEntityListener, EventCostsCalculatorEntityListener, EventIsTemplateEntityListener, EventPeriodEntityListener, EventPropagationEntityListener, EventRequirementEntityListener, EventSeminarRelationEntityListener, EventStatusEntityListener, ExamTemplateNumberingListener, ExpenseCalculateCostEntityListener, FlipUserSalutationEntityListener, FunctionMutationEntityListener, GenerateRegistrationUuidEntityListener, GenericCalendarEventListener, InitNodeRightsEntityListener, InputEntityListener, InvalidateCmsTemplateCacheListener, LecturerBookingPropagationEntityListener, LecturerBookingTotalLessonsEntityListener, LecturerBookingUserUpdateListener, LicenceBillingPositionEntityListener, LicenceEntityListener, LinkedAnswerOptionEntityListener, LinkedQuestionEntityListener, MembershipBillingPositionEntityListener, MembershipUserAnswerEntityListener, MinimalPresenceDeleteEntityListener, MovementArticleEntityListener, MovementBillingPositionEntityListener, OfftimeEventMappingEntityListener, OneStandardValueEntityListener, OrderBillPrintedCheckEntityListener, OrderBillPrintedEntityListener, OrderDeletionEntityListener, OrderOrderRateEntityListener, OrderPositionDiscountEntityListener, OrderPositionPriceChangeEntityListener, OrderPositionSortingEntityListener, OrderPriceRecalculationEntityListener, OrderRateFeeEntityListener, OrderTextsEntityListener, PrepaymentStatusEntityListener, PrepaymentVoucherEntityListener, PrincipalEntityListener, PrincipalSessionEntityListener, PromotionCodeEntityListener, PromotionDataRegistrationListener, QualificationRegistrationInformationListener, QuestionnaireFixationEntityListener, RefreshOrderTotalsEntityListener, RegistrationEntityListener, RegistrationPropagationEntityListener, RegistrationRequirementEntityListener, RegistrationSetEntityListener, RegistrationStatusRelevantForGradeEntityListener, ReplaceBinaryEntityListener, RequirementAccomplishmentListener, RequirementCheckDateEntityListener, RequirementPackageEntityListener, RequirementRuleCheckEntityListener, ReservationCountEntityListener, ReservationPropagationEntityListener, ReservationRegistrationCountEntityListener, ReservationRegistrationEntityListener, ResetConflictsStatusListener, ResourceUpdateTimestampListener, SchoolingRegistrationEntityListener, ScriptEntityFacadeListener, SeminarPeriodCountEntityListener, SetAddressFieldsEntityListener, SetBusinessUnitListener, SetDefaultSalaryOnLecturerBookingEntityListener, SetEventArchivedEntityListener, SetEventPublicationDateEntityListener, SetInputDataRegistrationListener, SetMembershipTypeRelationsEntityListener, SetMergedOutputJobsStatusEntityListener, SetStatusDateEntityListener, SetUnbalancedPrepaymentFlagEntityListener, SmsContactCreatorEntityListener, SummarizeMaxPointsEntityListener, SurveyIntrusionEntityListener, SurveyUserIntrusionEntityListener, TermsConditionConfirmationSourceListener, ThresholdValueEntityListener, TimereportRecordEntityListener, TimereportSchemeDayEntityListener, TopicEntityListener, TransferCantonFromUserToSchoolingEntityListener, UniqueOrderTemplateListener, UpdateAddressBlockEntityListener, UpdateContingentOnMovementEntityListener, UpdateEventConnectionTypeListener, UpdateHierarchyListener, UpdateLoginEntityListener, UpdateOpenBalanceDueEntityListener, UpdatePagePositionEntityListener, UpdateReferencesListener, UpdateSectionPositionListener, UpdateUrlIndexListener, UpdateWidgetRecordListener, VoucherChangedEntityListener, VoucherStornoDebitorEntityListener, WidgetConfigUpdateListener, WidgetDomainSecretListener, ZipFieldsUpdateEntityListener

public abstract class CollectingEntityListener extends Object implements EntityFacadeListener, CommitListener, ContextListener

EntityFacadeListener that collects facade events up until the current transaction is about to be committed. Every EntityFacadeEvent that comes in after the berfore-commit is discarded. This especially applies to all EntityFacadeEvents that are generated due to this listener.

Subclasses can listen for the before-commit event by implementing the onBeforeCommit(Transaction) method. At this point the entities that have been created and/or updated are available via getAffectedEntities() (and some filtering methods like getCreatedEntities()). Additional data to each entity can be retrieved via getOldValues(Entity) and getRelationChanges(Entity)

Note, this listener must be registered with the @ThreadScope annotation and the @Listener(filter = "Resource") annotation to define the filter.