primaryKeyNull
StateObserver primaryKeyNull()
- Returns:
- a
StateObserver
indicating whether the primary key of the active entity is null
AbstractEntityEditModel
, SwingEntityEditModel
Entity
instances.static final PropertyValue<Boolean>
EntityEditEvents
static final PropertyValue<Boolean>
static final PropertyValue<Boolean>
void
add(ForeignKey foreignKey,
Collection<Entity> entities)
void
addAfterDeleteListener(Consumer<Collection<Entity>> listener)
void
addAfterInsertListener(Consumer<Collection<Entity>> listener)
void
addAfterUpdateListener(Consumer<Map<Entity.Key,Entity>> listener)
void
addBeforeDeleteListener(Consumer<Collection<Entity>> listener)
void
addBeforeInsertListener(Consumer<Collection<Entity>> listener)
void
addBeforeUpdateListener(Consumer<Map<Entity.Key,Entity>> listener)
void
addConfirmOverwriteListener(Consumer<State> listener)
<T> void
addEditListener(Attribute<T> attribute,
Consumer<T> listener)
put(Attribute, Object)
or remove(Attribute)
, note that this event is only fired
if the value actually changes.void
addEntityListener(Consumer<Entity> listener)
set(Entity)
or setDefaults()
.void
addInsertUpdateOrDeleteListener(Runnable listener)
void
addValueChangeListener(Consumer<Attribute<?>> listener)
<T> void
addValueListener(Attribute<T> attribute,
Consumer<T> listener)
boolean
containsSearchModel(ForeignKey foreignKey)
EntitySearchModel
for the given foreign keycreateForeignKeySearchModel(ForeignKey foreignKey)
EntitySearchModel
for looking up entities referenced by the given foreign key,
using the search attributes defined for that entity type.void
delete()
void
delete(Collection<? extends Entity> entities)
entities()
entity()
exists()
foreignKeySearchModel(ForeignKey foreignKey)
<T> T
insert()
insert(Collection<? extends Entity> entities)
modified()
StateObserver
indicating when and if any values in the underlying Entity have been modified.StateObserver
instance indicating whether the value of the given attribute has been modified.boolean
<T> Optional<T>
<T> T
readOnly()
referencedEntity(ForeignKey foreignKey)
void
<T> T
void
remove(ForeignKey foreignKey,
Collection<Entity> entities)
void
removeAfterDeleteListener(Consumer<Collection<Entity>> listener)
void
removeAfterInsertListener(Consumer<Collection<Entity>> listener)
void
removeAfterUpdateListener(Consumer<Map<Entity.Key,Entity>> listener)
void
removeBeforeDeleteListener(Consumer<Collection<Entity>> listener)
void
removeBeforeInsertListener(Consumer<Collection<Entity>> listener)
void
removeBeforeUpdateListener(Consumer<Map<Entity.Key,Entity>> listener)
void
removeConfirmOverwriteListener(Consumer<State> listener)
<T> void
removeEditListener(Attribute<T> attribute,
Consumer<T> listener)
void
removeEntityListener(Consumer<Entity> listener)
void
removeInsertUpdateOrDeleteListener(Runnable listener)
void
removeValueChangeListener(Consumer<Attribute<?>> listener)
<T> void
removeValueListener(Attribute<T> attribute,
Consumer<T> listener)
void
replace(ForeignKey foreignKey,
Collection<Entity> entities)
entities
, useful when attribute
values have been changed in the referenced entity that must be reflected in the edit model.void
<T> void
setDefault(Attribute<T> attribute,
Supplier<T> defaultValue)
void
update()
update(Collection<? extends Entity> entities)
valid()
void
validate()
void
void
void
validate(Collection<? extends Entity> entities)
<T> Value<T>
attribute
in this edit model, note that
subsequent calls for the same attribute return the same value instance.EntityEditEvents
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 editedattribute
- 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 EntitySearchModel
EntitySearchModel
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 keyEntitySearchModel
for the given foreign keyforeignKey
- the foreign keyEntitySearchModel
has been initialized for the given foreign keyforeignKey
- the foreign key for which to retrieve the EntitySearchModel
EntitySearchModel
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 attributeDatabaseException
- in case of a database exceptionValidationException
- in case validation failsIllegalStateException
- in case inserting is not enabledentities
- the entities to insertDatabaseException
- in case of a database exceptionValidationException
- in case validation failsIllegalStateException
- in case inserting is not enabledDatabaseException
- in case of a database exceptionRecordModifiedException
- in case the entity has been modified since it was loadedValidationException
- in case validation failsIllegalStateException
- in case updating is not enabledUpdateException
- in case the active entity is not modifiedentities
- the entities to updateDatabaseException
- in case of a database exceptionRecordModifiedException
- in case an entity has been modified since it was loadedValidationException
- in case validation failsIllegalStateException
- in case updating is not enabledDatabaseException
- in case of a database exceptionIllegalStateException
- in case deleting is not enabledentities
- the entities to deleteDatabaseException
- in case of a database exceptionIllegalStateException
- in case deleting is not enabledforeignKey
- 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 withValidationException
- if the given value is not valid for the given attributeValidationException
- in case the entity is invalidentities
- the entities to validateValidationException
- on finding the first invalid entityentity
- the entity to validateValidationException
- in case the entity is invalidNullPointerException
- in case the entity is nullStateObserver
indicating the valid status of the underlying 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