EntityType.
Instances are static and shared per entity type (see persistenceEvents(EntityType)).
The PersistenceEvents.Inserted, PersistenceEvents.Updated and PersistenceEvents.Deleted events extend Consumer,
so any code - not just the editor - may publish persistence events.
The bus is shared by the whole JVM and knows nothing of connections: a listener hears the events of every editor
in the JVM, whichever connection persisted the entities. This assumes one database per JVM, where two connections
to it see each other's changes, as they should. Where one JVM connects to several databases with the same entity
types, opt out on either side: an editor via EntityEditor.Settings.publishPersistenceEvents(), or
EntityEditor.PUBLISH_PERSISTENCE_EVENTS for all, a model listening via its persistenceAware()
builder option, see EntityComboBoxModel.PERSISTENCE_AWARE and EntitySearchModel.PERSISTENCE_AWARE.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceNotified on delete.static interfaceNotified on insert.static interfaceNotified on update. -
Method Summary
Modifier and TypeMethodDescriptiondeleted()Returns aPersistenceEvents.Deleted, notified each time entities are deleted.inserted()Returns anPersistenceEvents.Inserted, notified each time entities are inserted.Notified when entities have been persisted, that is, inserted, updated or deleted.static PersistenceEventspersistenceEvents(EntityType entityType) updated()Returns anPersistenceEvents.Updated, notified each time entities are updated.
-
Method Details
-
persistenceEvents
- Parameters:
entityType- the entity type- Returns:
- the central
PersistenceEventsinstance for the given entity type
-
inserted
PersistenceEvents.Inserted inserted()Returns anPersistenceEvents.Inserted, notified each time entities are inserted.- Returns:
- the
PersistenceEvents.Insertedinstance
-
updated
PersistenceEvents.Updated updated()Returns anPersistenceEvents.Updated, notified each time entities are updated.- Returns:
- the
PersistenceEvents.Updatedinstance
-
deleted
PersistenceEvents.Deleted deleted()Returns aPersistenceEvents.Deleted, notified each time entities are deleted.- Returns:
- the
PersistenceEvents.Deletedinstance
-
persisted
Observer<Collection<Entity>> persisted()Notified when entities have been persisted, that is, inserted, updated or deleted.- See Also:
-