primaryKeyNull
is.codion.common.state.StateObserver primaryKeyNull()
- Returns:
- a
StateObserverindicating whether the primary key of the active entity is null
AbstractEntityEditModelEntity instances.static interface static interface static interface static final is.codion.common.property.PropertyValue<Boolean>EntityEditEventsstatic final is.codion.common.property.PropertyValue<Boolean>static final is.codion.common.property.PropertyValue<Boolean>voidadd(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey,
Collection<is.codion.framework.domain.entity.Entity> entities) voidaddAfterDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidaddAfterInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidaddAfterUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) voidaddBeforeDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidaddBeforeInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidaddBeforeUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) voidaddConfirmOverwriteListener(Consumer<is.codion.common.state.State> listener) <T> voidaddEditListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) put(Attribute, Object) or remove(Attribute), note that this event is only fired
if the value actually changes.voidaddEntityListener(Consumer<is.codion.framework.domain.entity.Entity> listener) set(Entity) or setDefaults().voidaddInsertUpdateOrDeleteListener(Runnable listener) voidaddValueChangeListener(Consumer<is.codion.framework.domain.entity.attribute.Attribute<?>> listener) <T> voidaddValueListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) is.codion.framework.db.EntityConnectionProviderEntityEditModel.Delete instance for deleting the active entity.createDelete(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.EntityEditModel.Insert instance for inserting the active entity.createInsert(Collection<is.codion.framework.domain.entity.Entity> entities) EntityEditModel.Insert instance for inserting the given entities.EntityEditModel.Update instance for updating the active entity.createUpdate(Collection<is.codion.framework.domain.entity.Entity> entities) EntityEditModel.Update instance for updating the given entities.voiddelete()voiddelete(Collection<is.codion.framework.domain.entity.Entity> entities) is.codion.common.state.Stateis.codion.common.state.Stateis.codion.framework.domain.entity.Entitiesentities()is.codion.framework.domain.entity.Entityentity()is.codion.framework.domain.entity.EntityDefinitionis.codion.framework.domain.entity.EntityTypeis.codion.common.state.StateObserverexists()foreignKeySearchModel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) <T> Tget(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) is.codion.framework.domain.entity.Entityinsert()Collection<is.codion.framework.domain.entity.Entity>insert(Collection<is.codion.framework.domain.entity.Entity> entities) is.codion.common.state.Stateis.codion.common.state.StateObserverisNotNull(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) is.codion.common.state.StateObserverisNull(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) is.codion.common.state.StateObservermodified()StateObserver indicating when and if any values in the underlying Entity have been modified.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.booleannullable(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) <T> Optional<T>optional(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) is.codion.common.state.Stateis.codion.common.state.Statepersist(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) is.codion.common.state.StateObserver<T> Tput(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
T value) is.codion.common.state.StatereadOnly()is.codion.framework.domain.entity.EntityreferencedEntity(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) void<T> Tremove(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) voidremove(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey,
Collection<is.codion.framework.domain.entity.Entity> entities) voidremoveAfterDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidremoveAfterInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidremoveAfterUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) voidremoveBeforeDeleteListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidremoveBeforeInsertListener(Consumer<Collection<is.codion.framework.domain.entity.Entity>> listener) voidremoveBeforeUpdateListener(Consumer<Map<is.codion.framework.domain.entity.Entity.Key,is.codion.framework.domain.entity.Entity>> listener) voidremoveConfirmOverwriteListener(Consumer<is.codion.common.state.State> listener) <T> voidremoveEditListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) voidremoveEntityListener(Consumer<is.codion.framework.domain.entity.Entity> listener) voidremoveInsertUpdateOrDeleteListener(Runnable listener) voidremoveValueChangeListener(Consumer<is.codion.framework.domain.entity.attribute.Attribute<?>> listener) <T> voidremoveValueListener(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Consumer<T> listener) 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.voidset(is.codion.framework.domain.entity.Entity entity) Entity into the underlying
Entity being edited by this edit model.<T> voidsetDefault(is.codion.framework.domain.entity.attribute.Attribute<T> attribute,
Supplier<T> defaultValue) voidis.codion.framework.domain.entity.Entityupdate()Collection<is.codion.framework.domain.entity.Entity>update(Collection<is.codion.framework.domain.entity.Entity> entities) is.codion.common.state.Stateis.codion.common.state.Stateis.codion.common.state.StateObservervalid()is.codion.common.state.StateObservervalid(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) voidvalidate()voidvalidate(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) voidvalidate(is.codion.framework.domain.entity.Entity entity) voidvalidate(Collection<is.codion.framework.domain.entity.Entity> entities) <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.EntityEditEventssetDefault(Attribute, Supplier)AttributeDefinition.defaultValue()Entity into the underlying
Entity being edited by this edit model. If entity is null
the effect is the same as calling setDefaults().entity - the entityEntity instance being editedEntity.immutable()attribute - the attributeStateObserver indicating whether the value of the given attribute is nullattribute - the attributeStateObserver indicating whether the value of the given attribute is not nullattribute - the attributeT - the value typeattribute - the attribute to associate the given value withvalue - the value to associate with the given attributeT - the value typeattribute - the attributeT - the value typeattribute - the attributeT - the value typeattribute - the attributeforeignKey - the foreign keyattribute in this edit model, note that
subsequent calls for the same attribute return the same value instance.T - the value typeattribute - the attributeinsertEnabled(), updateEnabled() and deleteEnabled()
to configure the enabled state of those specific actions.EntitySearchModel for looking up entities referenced by the given foreign key,
using the search attributes defined for that entity type.foreignKey - the foreign key for which to create a EntitySearchModelEntitySearchModel for looking up entities of the type referenced by the given foreign key attribute,IllegalStateException - in case no searchable attributes can be found for the entity type referenced by the given foreign keyforeignKey - 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.setDefaults() or set(Entity) with a null parameter to populate the model with the default values.T - the value typeattribute - the attributedefaultValue - the default value supplierEntityEditEvents event bus.attribute - the attributeis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.framework.domain.entity.exception.ValidationException - in case validation failsIllegalStateException - in case inserting is not enabledEntityValidator.validate(Entity)entities - the entities to insertis.codion.common.db.exception.DatabaseException - in case of a database exceptionis.codion.framework.domain.entity.exception.ValidationException - in case validation failsIllegalStateException - in case inserting is not enabledaddBeforeInsertListener(Consumer)addAfterInsertListener(Consumer)EntityValidator.validate(Entity)is.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.framework.domain.entity.exception.ValidationException - in case validation failsIllegalStateException - in case updating is not enabledis.codion.common.db.exception.UpdateException - in case the active entity is not modifiedEntityValidator.validate(Entity)entities - 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 failsIllegalStateException - in case updating is not enabledaddBeforeUpdateListener(Consumer)addAfterUpdateListener(Consumer)EntityValidator.validate(Entity)is.codion.common.db.exception.DatabaseException - in case of a database exceptionIllegalStateException - in case deleting is not enabledentities - the entities to deleteis.codion.common.db.exception.DatabaseException - in case of a database exceptionIllegalStateException - in case deleting is not enabledEntityEditModel.Insert instance for inserting the active entity.EntityEditModel.Insert instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.Insert instance for inserting the given entities.entities - the entities to insertEntityEditModel.Insert instanceis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.Update instance for updating the active entity.EntityEditModel.Update instanceIllegalArgumentException - in case the active entity is unmodifiedis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.Update instance for updating the given entities.entities - the entities to updateEntityEditModel.Update instanceIllegalArgumentException - in case any of the given entities are unmodifiedis.codion.framework.domain.entity.exception.ValidationException - in case validation failsEntityEditModel.Delete instance for deleting the active entity.EntityEditModel.Delete instanceEntityEditModel.Delete instance for deleting the given entities.entities - the entities to deleteEntityEditModel.Delete instanceforeignKey - the foreign keyentities - the valuesforeignKey - the foreign keyentities - the valuesentities, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.foreignKey - the foreign keyentities - the foreign key entitiesattribute - the attribute the value is associated withis.codion.framework.domain.entity.exception.ValidationException - if the given value is not valid for the given attributeis.codion.framework.domain.entity.exception.ValidationException - in case the entity is invalidentities - the entities to validateis.codion.framework.domain.entity.exception.ValidationException - on finding the first invalid entityEntityDefinition.validator()entity - the entity to validateis.codion.framework.domain.entity.exception.ValidationException - in case the entity is invalidNullPointerException - in case the entity is nullStateObserver indicating the valid status of the underlying Entity.validate(Attribute)EntityValidator.validate(Entity)attribute - the attributeStateObserver indicating the valid status of the given attribute.StateObserver indicating when and if any values in the underlying Entity have been modified.StateObserver indicating the modified state of this edit modelStateObserver instance indicating whether the value of the given attribute has been modified.attribute - the attributeStateObserver indicating the modified state of the value of the given attributeIllegalArgumentException - in case attribute is not part of the underlying entityStateObserver indicating whether the active entity exists in the databaseStateObserver indicating whether the primary key of the active entity is nullput(Attribute, Object) or remove(Attribute), note that this event is only fired
if the value actually changes.T - 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 modelT - the value typeattribute - the attributelistener - the listener to removeT - the value typeattribute - the attribute for which to monitor value changeslistener - a listener notified each time the value of the attribute changesT - the value typeattribute - the attribute for which to remove the listenerlistener - the listener to removelistener - a listener notified each time a value changes, providing the attributelistener - the listener to removeset(Entity) or setDefaults().listener - a listener notified each time the entity is set, possibly to nulllistener - the listener to removelistener - a listener to be notified before an insert is performedlistener - a listener to removelistener - a listener to be notified each time insert has been performedlistener - a listener to removelistener - a listener to be notified before an update is performedlistener - a listener to removelistener - 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 performedlistener - a listener to removelistener - a listener to be notified before a delete is performedlistener - a listener to removelistener - a listener to be notified each time delete has been performedlistener - a listener to removelistener - a listener notified each time one or more entities are updated, inserted or deleted via this modellistener - a listener to removelistener - a listener notified each time the active entity is about to be setlistener - a listener to remove