类 EntityEvent<E>
- 所有已实现的接口:
DatabaseEvent
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanstatic <E> EntityEvent<E>evict(org.babyfish.jimmer.meta.ImmutableType immutableType, Object id, Connection con, Object reason) <T> @Nullable ChangedRef<T>getChangedRef(org.babyfish.jimmer.meta.ImmutableProp prop) Get the changed ref of specified property<T> @Nullable ChangedRef<T>getChangedRef(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the changed ref of specified property@Nullable ConnectionDetermine whether the trigger for sending the current event is within a transaction or based on binlog If the event is fired by binlog trigger, returns null If the event is fired by transaction trigger, returns current trigger@NotNull ObjectgetId()@NotNull org.babyfish.jimmer.meta.ImmutableTypeGet the new entity no matter it is logically deleted or notGet the old entity no matter it is logically deleted or not@Nullable Object@NotNull EntityEvent.TypegetType()<T> @Nullable org.babyfish.jimmer.lang.Ref<T>getUnchangedRef(org.babyfish.jimmer.meta.ImmutableProp prop) Get the unchanged ref of specified property<T> @Nullable org.babyfish.jimmer.lang.Ref<T>getUnchangedRef(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the unchanged ref of specified property<T> TgetUnchangedValue(org.babyfish.jimmer.meta.ImmutableProp prop) Get the value of specified property if it is not changed.<T> TgetUnchangedValue(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the value of specified property if it is not changed.inthashCode()booleanisChanged(org.babyfish.jimmer.meta.ImmutableProp prop) Is the value of specified property changed.booleanisChanged(org.babyfish.jimmer.meta.TypedProp<?, ?> prop) Is the value of specified property changedbooleanisEvict()Is the current event an evict event which does not supportgetOldEntity()getNewEntity()getChangedRef(TypedProp.Single)getChangedRef(ImmutableProp)getUnchangedRef(TypedProp.Single)getUnchangedRef(ImmutableProp)getUnchangedValue(TypedProp.Single)getUnchangedRef(ImmutableProp)toString()
-
构造器详细资料
-
EntityEvent
-
-
方法详细资料
-
evict
public static <E> EntityEvent<E> evict(org.babyfish.jimmer.meta.ImmutableType immutableType, Object id, Connection con, Object reason) Create an evict event which does not support- 类型参数:
E-- 参数:
immutableType-id-con-reason-- 返回:
-
getOldEntity
Get the old entity no matter it is logically deleted or notThis method is not supported by evict event by throwing IllegalStateException
- 返回:
- The old entity
- 抛出:
IllegalStateException- The current event is an evict event
-
getNewEntity
Get the new entity no matter it is logically deleted or notThis method is not supported by evict event by throwing IllegalStateException
- 返回:
- The new entity
- 抛出:
IllegalStateException- The current event is an evict event
-
getId
-
isChanged
public boolean isChanged(org.babyfish.jimmer.meta.ImmutableProp prop) 从接口复制的说明:DatabaseEventIs the value of specified property changed.- 指定者:
isChanged在接口中DatabaseEvent- 参数:
prop- The specified property- 返回:
- Is the value of specified property changed
- If the current event is
EntityEvent, returns whether the declaring type of specified property is assignable from the entity type of current event object and whether the value of specified property is changed. - If the current event is
AssociationEventreturns whether the specified property isAssociationEvent.getImmutableProp()
- If the current event is
-
isChanged
public boolean isChanged(org.babyfish.jimmer.meta.TypedProp<?, ?> prop) 从接口复制的说明:DatabaseEventIs the value of specified property changed- 指定者:
isChanged在接口中DatabaseEvent- 参数:
prop- The specified property- 返回:
- Is the value of specified property changed
- If the current event is
EntityEvent, returns whether the declaring type of specified property is assignable from the entity type of current event object and whether the value of specified property is changed. - If the current event is
AssociationEventreturns whether the specified property isAssociationEvent.getImmutableProp()
- If the current event is
-
getConnection
从接口复制的说明:DatabaseEventDetermine whether the trigger for sending the current event is within a transaction or based on binlog- If the event is fired by binlog trigger, returns null
- If the event is fired by transaction trigger, returns current trigger
Notes, If you use jimmer in spring-boot and accept events with `@EventListener`, it will be very important to determine whether this property is null. Because once the `triggerType` of `SqlClient` is set to `BOTH`, the same event will be notified twice.
- 指定者:
getConnection在接口中DatabaseEvent- 返回:
- The current connection or null
-
getReason
- 指定者:
getReason在接口中DatabaseEvent
-
getImmutableType
@NotNull public @NotNull org.babyfish.jimmer.meta.ImmutableType getImmutableType() -
getType
-
isEvict
public boolean isEvict()Is the current event an evict event which does not support- 指定者:
isEvict在接口中DatabaseEvent- 返回:
- Is the current event an evict event
-
getUnchangedRef
@Nullable public <T> @Nullable org.babyfish.jimmer.lang.Ref<T> getUnchangedRef(org.babyfish.jimmer.meta.ImmutableProp prop) Get the unchanged ref of specified propertyThis method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of specified property- 参数:
prop- The specified property- 返回:
- If the value of specified property is NOT changed, return a ref object which is the wrapper of unchanged value; otherwise, return null.
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException- The declaring type of specified property is not assignable from the entity type of current event object
-
getUnchangedRef
@Nullable public <T> @Nullable org.babyfish.jimmer.lang.Ref<T> getUnchangedRef(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the unchanged ref of specified propertyThis method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of specified property- 参数:
prop- The specified property- 返回:
- If the value of specified property is NOT changed, return a ref object which is the wrapper of unchanged value; otherwise, return null.
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException- The declaring type of specified property is not assignable from the entity type of current event object
-
getChangedRef
@Nullable public <T> @Nullable ChangedRef<T> getChangedRef(org.babyfish.jimmer.meta.ImmutableProp prop) Get the changed ref of specified propertyThis method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of specified property- 参数:
prop- The specified property- 返回:
- If the value of specified property is NOT changed, return a changed ref object which is a wrapper of both old value and new value; otherwise, return null.
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException- The declaring type of specified property is not assignable from the entity type of current event object
-
getChangedRef
@Nullable public <T> @Nullable ChangedRef<T> getChangedRef(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the changed ref of specified propertyThis method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of specified property- 参数:
prop- The specified property- 返回:
- If the value of specified property is NOT changed, return a changed ref object which is a wrapper of both old value and new value; otherwise, return null.
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException- The declaring type of specified property is not assignable from the entity type of current event object
-
getUnchangedValue
public <T> T getUnchangedValue(org.babyfish.jimmer.meta.ImmutableProp prop) Get the value of specified property if it is not changed.This method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of returned property- 参数:
prop- The specified property- 返回:
- The unchanged value of specified property
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException-- The declaring type of specified property is not assignable from the entity type of current event object
- The value of specified property is changed
-
getUnchangedValue
public <T> T getUnchangedValue(org.babyfish.jimmer.meta.TypedProp.Single<?, T> prop) Get the value of specified property if it is not changed.This method is not supported by evict event by throwing IllegalStateException
If old/new entity is not null but is logically deleted, old/new entity will be considered as null
- 类型参数:
T- The return type of returned property- 参数:
prop- The specified property- 返回:
- The unchanged value of specified property
- 抛出:
IllegalStateException- The current event type is EVICTIllegalArgumentException-- The declaring type of specified property is not assignable from the entity type of current event object
- The value of specified property is changed
-
hashCode
public int hashCode() -
equals
-
toString
-