primaryKeyNull
public final is.codion.common.state.StateObserver primaryKeyNull()
- Specified by:
primaryKeyNullin interfaceEntityEditModel- Returns:
- a
StateObserverindicating whether the primary key of the active entity is null
EntityEditModelEntityEditModel implementationEntityEditModel.Delete, EntityEditModel.Insert, EntityEditModel.UpdateEDIT_EVENTS, PERSIST_FOREIGN_KEYS, WARN_ABOUT_UNSAVED_DATAprotected AbstractEntityEditModel(is.codion.framework.domain.entity.EntityType entityType,
is.codion.framework.db.EntityConnectionProvider connectionProvider) AbstractEntityEditModel based on the given entity type.final voidaddAfterDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidaddAfterInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidaddAfterUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) final voidaddBeforeDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidaddBeforeInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidaddBeforeUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) final voidaddConfirmOverwriteListener(Consumer<is.codion.common.state.State> listener) final <T> voidaddEditListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) EntityEditModel.put(Attribute, Object) or EntityEditModel.remove(Attribute), note that this event is only fired
if the value actually changes.final voidaddEntityListener(Consumer<is.codion.framework.domain.entity.Entity> listener) EntityEditModel.set(Entity) or EntityEditModel.setDefaults().final voidaddInsertUpdateOrDeleteListener(Runnable listener) final voidaddValueChangeListener(Consumer<is.codion.framework.domain.entity.attribute.Attribute<?>> listener) final <T> voidaddValueListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) final is.codion.framework.db.EntityConnectionProviderfinal EntityEditModel.DeleteEntityEditModel.Delete instance for deleting the active entity.final EntityEditModel.DeletecreateDelete(Collection<is.codion.framework.domain.entity.Entity> entities) EntityEditModel.Delete instance for deleting the given entities.createForeignKeySearchModel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) EntitySearchModel for looking up entities referenced by the given foreign key,
using the search attributes defined for that entity type.final EntityEditModel.InsertEntityEditModel.Insert instance for inserting the active entity.final EntityEditModel.InsertcreateInsert(Collection<is.codion.framework.domain.entity.Entity> entities) EntityEditModel.Insert instance for inserting the given entities.final EntityEditModel.UpdateEntityEditModel.Update instance for updating the active entity.final EntityEditModel.UpdatecreateUpdate(Collection<is.codion.framework.domain.entity.Entity> entities) EntityEditModel.Update instance for updating the given entities.final voiddelete()final voiddelete(Collection<is.codion.framework.domain.entity.Entity> entities) protected voiddelete(Collection<is.codion.framework.domain.entity.Entity> entities,
is.codion.framework.db.EntityConnection connection) final is.codion.common.state.Statefinal is.codion.common.state.Statefinal is.codion.framework.domain.entity.Entitiesentities()final is.codion.framework.domain.entity.Entityentity()final is.codion.framework.domain.entity.EntityDefinitionfinal is.codion.framework.domain.entity.EntityTypefinal is.codion.common.state.StateObserverexists()protected final is.codion.common.value.Value<Predicate<is.codion.framework.domain.entity.Entity>>final EntitySearchModelforeignKeySearchModel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) final <T> Tget(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) final is.codion.framework.domain.entity.Entityinsert()final Collection<is.codion.framework.domain.entity.Entity>insert(Collection<is.codion.framework.domain.entity.Entity> entities) protected Collection<is.codion.framework.domain.entity.Entity>insert(Collection<is.codion.framework.domain.entity.Entity> entities,
is.codion.framework.db.EntityConnection connection) final is.codion.common.state.Statefinal is.codion.common.state.StateObserverisNotNull(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) final is.codion.common.state.StateObserverisNull(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) final is.codion.common.state.StateObservermodified()StateObserver indicating when and if any values in the underlying Entity have been modified.final is.codion.common.state.StateObservermodified(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) StateObserver instance indicating whether the value of the given attribute has been modified.protected final is.codion.common.value.Value<Predicate<is.codion.framework.domain.entity.Entity>>protected final voidnotifyAfterDelete(Collection<is.codion.framework.domain.entity.Entity> deletedEntities) protected final voidnotifyAfterInsert(Collection<is.codion.framework.domain.entity.Entity> insertedEntities) protected final voidnotifyAfterUpdate(Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity> updatedEntities) protected final voidnotifyBeforeDelete(Collection<is.codion.framework.domain.entity.Entity> entitiesToDelete) protected final voidnotifyBeforeInsert(Collection<is.codion.framework.domain.entity.Entity> entitiesToInsert) protected final voidnotifyBeforeUpdate(Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity> entitiesToUpdate) final booleannullable(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) final <T> Optional<T>optional(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) final is.codion.common.state.Statefinal is.codion.common.state.Statepersist(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) final is.codion.common.state.StateObserverfinal <T> Tput(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
T value) final is.codion.common.state.StatereadOnly()final is.codion.framework.domain.entity.EntityreferencedEntity(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) final voidfinal <T> Tremove(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) final voidremoveAfterDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidremoveAfterInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidremoveAfterUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) final voidremoveBeforeDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidremoveBeforeInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) final voidremoveBeforeUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) final voidremoveConfirmOverwriteListener(Consumer<is.codion.common.state.State> listener) final <T> voidremoveEditListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) final voidremoveEntityListener(Consumer<is.codion.framework.domain.entity.Entity> listener) final voidremoveInsertUpdateOrDeleteListener(Runnable listener) final voidremoveValueChangeListener(Consumer<is.codion.framework.domain.entity.attribute.Attribute<?>> listener) final <T> voidremoveValueListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) final voidreplace(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey,
Collection<is.codion.framework.domain.entity.Entity> entities) entities, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.protected voidreplaceForeignKey(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey,
Collection<is.codion.framework.domain.entity.Entity> values) values, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.final voidset(is.codion.framework.domain.entity.Entity entity) Entity into the underlying
Entity being edited by this edit model.final <T> voidsetDefault(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Supplier<T> defaultValue) final voidfinal StringtoString()final is.codion.framework.domain.entity.Entityupdate()final Collection<is.codion.framework.domain.entity.Entity>update(Collection<is.codion.framework.domain.entity.Entity> entities) protected Collection<is.codion.framework.domain.entity.Entity>update(Collection<is.codion.framework.domain.entity.Entity> entities,
is.codion.framework.db.EntityConnection connection) final is.codion.common.state.Stateprotected final voidfinal is.codion.common.state.Statefinal is.codion.common.state.StateObservervalid()final is.codion.common.state.StateObservervalid(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) final voidvalidate()final voidvalidate(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) voidvalidate(is.codion.framework.domain.entity.Entity entity) final voidvalidate(Collection<is.codion.framework.domain.entity.Entity> entities) protected final is.codion.common.value.Value<is.codion.framework.domain.entity.EntityValidator>final <T> is.codion.common.value.Value<T>value(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) attribute in this edit model, note that
subsequent calls for the same attribute return the same value instance.clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, removeAbstractEntityEditModel based on the given entity type.entityType - the type of the entity to base this AbstractEntityEditModel onconnectionProvider - the EntityConnectionProvider instanceentities in interface EntityEditModelentityDefinition in interface EntityEditModelEntityEditModelEntityEditModel.setDefaults() or EntityEditModel.set(Entity) with a null parameter to populate the model with the default values.setDefault in interface EntityEditModelT - the value typeattribute - the attributedefaultValue - the default value supplieroverwriteWarning in interface EntityEditModeleditEvents in interface EntityEditModelEntityEditEvents event bus.EntityEditModelpersist in interface EntityEditModelattribute - the attributeEntityEditModelEntityEditModel.insertEnabled(), EntityEditModel.updateEnabled() and EntityEditModel.deleteEnabled()
to configure the enabled state of those specific actions.readOnly in interface EntityEditModelEntityEditModelinsertEnabled in interface EntityEditModelEntityEditModelupdateEnabled in interface EntityEditModelEntityEditModelupdateMultipleEnabled in interface EntityEditModelEntityEditModeldeleteEnabled in interface EntityEditModelexists in interface EntityEditModelStateObserver indicating whether the active entity exists in the databaseprimaryKeyNull in interface EntityEditModelStateObserver indicating whether the primary key of the active entity is nullEntityEditModelEntity into the underlying
Entity being edited by this edit model. If entity is null
the effect is the same as calling EntityEditModel.setDefaults().set in interface EntityEditModelentity - the entityEntityEditModelsetDefaults in interface EntityEditModelEntityEditModel.setDefault(Attribute, Supplier)AttributeDefinition.defaultValue()entityType in interface EntityEditModelconnectionProvider in interface EntityEditModelEntityEditModelentities, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.replace in interface EntityEditModelforeignKey - the foreign keyentities - the foreign key entitiesentity in interface EntityEditModelEntity instance being editedEntity.immutable()EntityEditModelreferencedEntity in interface EntityEditModelforeignKey - the foreign keyEntityEditModelStateObserver indicating when and if any values in the underlying Entity have been modified.modified in interface EntityEditModelStateObserver indicating the modified state of this edit modelEntityEditModelStateObserver instance indicating whether the value of the given attribute has been modified.modified in interface EntityEditModelattribute - the attributeStateObserver indicating the modified state of the value of the given attributeEntityEditModelget in interface EntityEditModelT - the value typeattribute - the attributeEntityEditModeloptional in interface EntityEditModelT - the value typeattribute - the attributeEntityEditModelput in interface EntityEditModelT - the value typeattribute - the attribute to associate the given value withvalue - the value to associate with the given attributeEntityEditModelremove in interface EntityEditModelT - the value typeattribute - the attributenullable in interface EntityEditModelattribute - the attributeisNull in interface EntityEditModelattribute - the attributeStateObserver indicating whether the value of the given attribute is nullisNotNull in interface EntityEditModelattribute - the attributeStateObserver indicating whether the value of the given attribute is not nullvalid in interface EntityEditModelStateObserver indicating the valid status of the underlying Entity.EntityEditModel.validate(Attribute)EntityValidator.validate(Entity)valid in interface EntityEditModelattribute - the attributeStateObserver indicating the valid status of the given attribute.EntityEditModelvalidate in interface EntityEditModelattribute - the attribute the value is associated withis.codion.framework.domain.entity.exception.ValidationException - if the given value is not valid for the given attributeEntityEditModelvalidate in interface EntityEditModelis.codion.framework.domain.entity.exception.ValidationException - in case the entity is invalidEntityEditModelvalidate in interface EntityEditModelentities - the entities to validateis.codion.framework.domain.entity.exception.ValidationException - on finding the first invalid entityEntityDefinition.validator()EntityEditModelvalidate in interface EntityEditModelentity - the entity to validateis.codion.framework.domain.entity.exception.ValidationException - in case the entity is invalidEntityEditModelinsert in interface EntityEditModelis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityValidator.validate(Entity)EntityEditModelinsert in interface EntityEditModelentities - the entities to insertis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.addBeforeInsertListener(Consumer)EntityEditModel.addAfterInsertListener(Consumer)EntityValidator.validate(Entity)EntityEditModelupdate in interface EntityEditModelis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.common.db.exception.RecordModifiedException - in case the entity has been modified since it was loadedis.codion.common.db.exception.UpdateException - in case the active entity is not modifiedis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityValidator.validate(Entity)EntityEditModelupdate in interface EntityEditModelentities - the entities to updateis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.common.db.exception.RecordModifiedException - in case an entity has been modified since it was loadedis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.addBeforeUpdateListener(Consumer)EntityEditModel.addAfterUpdateListener(Consumer)EntityValidator.validate(Entity)EntityEditModeldelete in interface EntityEditModelis.codion.common.db.exception.DatabaseException - in case of a database exceptionEntityEditModeldelete in interface EntityEditModelentities - the entities to deleteis.codion.common.db.exception.DatabaseException - in case of a database exceptionEntityEditModelEntityEditModel.Insert instance for inserting the active entity.createInsert in interface EntityEditModelEntityEditModel.Insert instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModelEntityEditModel.Insert instance for inserting the given entities.createInsert in interface EntityEditModelentities - the entities to insertEntityEditModel.Insert instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModelEntityEditModel.Update instance for updating the active entity.createUpdate in interface EntityEditModelEntityEditModel.Update instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModelEntityEditModel.Update instance for updating the given entities.createUpdate in interface EntityEditModelentities - the entities to updateEntityEditModel.Update instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModelEntityEditModel.Delete instance for deleting the active entity.createDelete in interface EntityEditModelEntityEditModel.Delete instanceEntityEditModelEntityEditModel.Delete instance for deleting the given entities.createDelete in interface EntityEditModelentities - the entities to deleteEntityEditModel.Delete instanceEntityEditModelrefreshEntity in interface EntityEditModelEntityEditModelEntitySearchModel for looking up entities referenced by the given foreign key,
using the search attributes defined for that entity type.createForeignKeySearchModel in interface EntityEditModelforeignKey - the foreign key for which to create a EntitySearchModelEntitySearchModel for looking up entities of the type referenced by the given foreign key attribute,foreignKeySearchModel in interface EntityEditModelforeignKey - the foreign key for which to retrieve the EntitySearchModelEntitySearchModel associated with the foreignKey, if no search model
has been initialized for the given foreign key, a new one is created, associated with the foreign key and returned.EntityEditModelattribute in this edit model, note that
subsequent calls for the same attribute return the same value instance.value in interface EntityEditModelT - the value typeattribute - the attributeEntityEditModelremoveEditListener in interface EntityEditModelT - the value typeattribute - the attributelistener - the listener to removeEntityEditModelEntityEditModel.put(Attribute, Object) or EntityEditModel.remove(Attribute), note that this event is only fired
if the value actually changes.addEditListener in interface EntityEditModelT - the value typeattribute - the attribute for which to monitor value editslistener - a listener notified each time the value of the given attribute is edited via this modelEntityEditModelremoveValueListener in interface EntityEditModelT - the value typeattribute - the attribute for which to remove the listenerlistener - the listener to removeEntityEditModeladdValueListener in interface EntityEditModelT - the value typeattribute - the attribute for which to monitor value changeslistener - a listener notified each time the value of the attribute changesremoveValueChangeListener in interface EntityEditModellistener - the listener to removeaddValueChangeListener in interface EntityEditModellistener - a listener notified each time a value changes, providing the attributeEntityEditModelremoveEntityListener in interface EntityEditModellistener - the listener to removeEntityEditModelEntityEditModel.set(Entity) or EntityEditModel.setDefaults().addEntityListener in interface EntityEditModellistener - a listener notified each time the entity is set, possibly to nullEntityEditModelremoveBeforeInsertListener in interface EntityEditModellistener - a listener to removeaddBeforeInsertListener in interface EntityEditModellistener - a listener to be notified before an insert is performedEntityEditModelremoveAfterInsertListener in interface EntityEditModellistener - a listener to removeaddAfterInsertListener in interface EntityEditModellistener - a listener to be notified each time insert has been performedEntityEditModelremoveBeforeUpdateListener in interface EntityEditModellistener - a listener to removeaddBeforeUpdateListener in interface EntityEditModellistener - a listener to be notified before an update is performedEntityEditModelremoveAfterUpdateListener in interface EntityEditModellistener - a listener to removeaddAfterUpdateListener in interface EntityEditModellistener - a listener to be notified each time an update has been performed,
with the updated entities, mapped to their respective original primary keys, that is,
the primary keys before the update was performedaddBeforeDeleteListener in interface EntityEditModellistener - a listener to be notified before a delete is performedEntityEditModelremoveBeforeDeleteListener in interface EntityEditModellistener - a listener to removeEntityEditModelremoveAfterDeleteListener in interface EntityEditModellistener - a listener to removeaddAfterDeleteListener in interface EntityEditModellistener - a listener to be notified each time delete has been performedEntityEditModelremoveInsertUpdateOrDeleteListener in interface EntityEditModellistener - a listener to removeaddInsertUpdateOrDeleteListener in interface EntityEditModellistener - a listener notified each time one or more entities are updated, inserted or deleted via this modeladdConfirmOverwriteListener in interface EntityEditModellistener - a listener notified each time the active entity is about to be setEntityEditModelremoveConfirmOverwriteListener in interface EntityEditModellistener - a listener to removeentities - the entities to insertconnection - the connection to useis.codion.common.db.exception.DatabaseException - in case of a database exceptionentities - the entities to updateconnection - the connection to useis.codion.common.db.exception.DatabaseException - in case of a database exceptionentities - the entities to deleteconnection - the connection to useis.codion.common.db.exception.DatabaseException - in case of a database exceptionvalues, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.foreignKey - the foreign key attributevalues - the foreign key entitiesEntity.modified()modified()EntityDefinition.exists()Entity.exists()entitiesToInsert - the entities about to be insertedinsertedEntities - the inserted entitiesentitiesToUpdate - the entities about to be updatedupdatedEntities - the updated entitiesentitiesToDelete - the entities about to be deleteddeletedEntities - the deleted entities