com.kenshoo.pl.entity.EntityChange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity;
import java.util.Optional;
import java.util.stream.Stream;
public interface EntityChange> extends FieldsValueMap {
E getEntityType();
/**
* @return a stream of fields modified by this change, each field being included at most once
*/
Stream> getChangedFields();
/**
* Returns the value of the given transient property.
*
* @param transientProperty transient property to query; required
* @param type of the value
* @return the value of the property, or {@code Optional.empty()} if {@code null} or absent.
*/
Optional get(final TransientProperty transientProperty);
/**
* @return a stream of the individual field changes modified by this change. The stream does not include
* suppliers, only fixed values
*/
Stream> getChanges();
/**
* @return true
if the field is affected by this change, without checking suppliers
* @deprecated use {@link #isFieldChangedIncludingSuppliers(EntityField)}
*/
boolean isFieldChanged(EntityField field);
/**
* Same as {@link #isFieldChanged}, but also checks whether there is a supplier for the field if no value provided.
* @return true
if the field is affected by this change, either directly or through a supplier. A shorthand for getChangedFields().contains(field)
*/
boolean isFieldChangedIncludingSuppliers(EntityField field);
/**
* @return the identifier of the entity being changed. Works only for update or delete changes, not for create
*/
Identifier getIdentifier();
/**
* @return of stream of sub changes of the entity
*/
Stream extends EntityChange extends EntityType>> getChildren();
/**
* @return of stream of sub changes of the entity by child type
*/
> Stream extends EntityChange> getChildren(CHILD type);
/**
* @return the parent identifier of the entity
*/
Identifier getKeysToParent();
/**
* @return return change operation
*/
ChangeOperation getChangeOperation();
/**
* @return return if entity must be found for entity change
*/
default boolean allowMissingEntity() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy