接口 DatabaseEvent

所有已知实现类:
AssociationEvent, EntityEvent

public interface DatabaseEvent
  • 方法概要

    修饰符和类型
    方法
    说明
    @Nullable Connection
    Determine 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
    @Nullable Object
     
    boolean
    isChanged(org.babyfish.jimmer.meta.ImmutableProp prop)
    Is the value of specified property changed.
    boolean
    isChanged(org.babyfish.jimmer.meta.TypedProp<?,?> prop)
    Is the value of specified property changed
    boolean
     
  • 方法详细资料

    • isChanged

      boolean isChanged(org.babyfish.jimmer.meta.ImmutableProp prop)
      Is the value of specified property changed.
      参数:
      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 AssociationEvent returns whether the specified property is AssociationEvent.getImmutableProp()
    • isChanged

      boolean isChanged(org.babyfish.jimmer.meta.TypedProp<?,?> prop)
      Is the value of specified property changed
      参数:
      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 AssociationEvent returns whether the specified property is AssociationEvent.getImmutableProp()
    • getConnection

      @Nullable @Nullable Connection getConnection()
      Determine 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.

      返回:
      The current connection or null
    • getReason

      @Nullable @Nullable Object getReason()
    • isEvict

      boolean isEvict()