primaryKeyNull
StateObserver primaryKeyNull()
- Returns:
- a
StateObserver
indicating whether the primary key of the active entity is null
AbstractEntityEditModel
, SwingEntityEditModel
Entity
instances.static interface
static interface
static interface
static final PropertyValue<Boolean>
EntityEditEvents
static final PropertyValue<Boolean>
static final PropertyValue<Boolean>
void
add(ForeignKey foreignKey,
Collection<Entity> entities)
EntityEditModel.Delete
instance for deleting the active entity.createDelete(Collection<Entity> entities)
EntityEditModel.Delete
instance for deleting the given entities.createForeignKeySearchModel(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<Entity> entities)
EntityEditModel.Insert
instance for inserting the given entities.EntityEditModel.Update
instance for updating the active entity.createUpdate(Collection<Entity> entities)
EntityEditModel.Update
instance for updating the given entities.void
defaults()
defaultValue(Attribute<T> attribute)
Value
instance controlling the default value supplier for the given attribute.delete()
delete(Collection<Entity> entities)
<T> EventObserver<T>
put(Attribute, Object)
or remove(Attribute)
, note that this event is only fired
if the value actually changes.entities()
entity()
exists()
foreignKeySearchModel(ForeignKey foreignKey)
<T> T
insert()
insert(Collection<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()
void
refresh()
<T> T
void
remove(ForeignKey foreignKey,
Collection<Entity> entities)
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
revert()
<T> void
void
update()
update(Collection<Entity> entities)
valid()
void
validate()
void
void
void
validate(Collection<Entity> entities)
<T> Value<T>
attribute
in this edit model, note that
subsequent calls for the same attribute return the same value instance.<T> EventObserver<T>
valueEvent(Attribute<T> attribute)
EntityEditEvents
Entity
into the underlying
Entity
being edited by this edit model. If entity
is null
the effect is the same as calling defaults()
.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 attribute to revertattribute
- 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 attributeattribute
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 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.Value
instance controlling the default value supplier for the given attribute.
Used when the underlying value is not persistent. Use defaults()
or set(Entity)
with a null parameter to populate the model with the default values.S
- the value supplier typeT
- the value typeattribute
- the attributeValue
instance controlling 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 enabledEntityEditModel.Insert
instance for inserting the active entity.EntityEditModel.Insert
instanceValidationException
- in case validation failsEntityEditModel.Insert
instance for inserting the given entities.entities
- the entities to insertEntityEditModel.Insert
instanceValidationException
- in case validation failsEntityEditModel.Update
instance for updating the active entity.EntityEditModel.Update
instanceIllegalArgumentException
- in case the active entity is unmodifiedValidationException
- 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 unmodifiedValidationException
- 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 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 which edit observer to returnT
- the value typeattribute
- the attribute which value observer to returnset(Entity)
or defaults()
.