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 is.codion.common.event.EventObserver<Collection<is.codion.framework.domain.entity.Entity>>final is.codion.common.event.EventObserver<Collection<is.codion.framework.domain.entity.Entity>>final is.codion.common.event.EventObserver<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> final is.codion.common.event.EventObserver<Collection<is.codion.framework.domain.entity.Entity>>final is.codion.common.event.EventObserver<Collection<is.codion.framework.domain.entity.Entity>>final is.codion.common.event.EventObserver<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> final is.codion.common.event.EventObserver<is.codion.common.state.State>final is.codion.framework.db.EntityConnectionfinal 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 voiddefaults()final <S extends Supplier<T>,
T>
is.codion.common.value.Value<S> defaultValue(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Value instance controlling the default value supplier for the given attribute.final is.codion.framework.domain.entity.Entitydelete()final Collection<is.codion.framework.domain.entity.Entity>delete(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 <T> is.codion.common.event.EventObserver<T>editEvent(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) EntityEditModel.put(Attribute, Object) or EntityEditModel.remove(Attribute), note that this event is only fired
if the value actually changes.final 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.common.event.EventObserver<is.codion.framework.domain.entity.Entity>final 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.event.EventObserver<?>final 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 voidrefresh()final <T> Tremove(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) 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 voidrevert()final <T> voidrevert(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) final voidset(is.codion.framework.domain.entity.Entity entity) Entity into the underlying
Entity being edited by this edit model.final 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.final <T> is.codion.common.event.EventObserver<T>valueEvent(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) 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 EntityEditModelEntityEditModelValue instance controlling the default value supplier for the given attribute.
Used when the underlying value is not persistent. Use EntityEditModel.defaults() or EntityEditModel.set(Entity)
with a null parameter to populate the model with the default values.defaultValue in interface EntityEditModelS - the value supplier typeT - the value typeattribute - the attributeValue instance controlling 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.defaults().set in interface EntityEditModelentity - the entityEntityEditModeldefaults in interface EntityEditModelEntityEditModel.defaultValue(Attribute)AttributeDefinition.defaultValue()entityType in interface EntityEditModelconnectionProvider in interface EntityEditModelEntityEditModelconnection 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()EntityEditModelStateObserver 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 attributeEntityEditModelrevert in interface EntityEditModelrevert in interface EntityEditModelattribute - the attribute to revertnullable 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.beforeInsertEvent()EntityEditModel.afterInsertEvent()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.beforeUpdateEvent()EntityEditModel.afterUpdateEvent()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 instanceEntityEditModelrefresh 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 attributeEntityEditModelEntityEditModel.put(Attribute, Object) or EntityEditModel.remove(Attribute), note that this event is only fired
if the value actually changes.editEvent in interface EntityEditModelT - the value typeattribute - the attribute which edit observer to returnEntityEditModelvalueEvent in interface EntityEditModelT - the value typeattribute - the attribute which value observer to returnentityEvent in interface EntityEditModelEntityEditModel.set(Entity) or EntityEditModel.defaults().beforeInsertEvent in interface EntityEditModelafterInsertEvent in interface EntityEditModelbeforeUpdateEvent in interface EntityEditModelafterUpdateEvent in interface EntityEditModelbeforeDeleteEvent in interface EntityEditModelafterDeleteEvent in interface EntityEditModelinsertUpdateOrDeleteEvent in interface EntityEditModelconfirmOverwriteEvent in interface EntityEditModelentities - 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