Class PostgresChangeNotificationVisitor

java.lang.Object
io.micronaut.data.processor.visitors.PostgresChangeNotificationVisitor
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable, io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>

@Internal public final class PostgresChangeNotificationVisitor extends Object implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Processes @PostgresChangeNotification methods during compilation.

The visitor verifies that the method is also a @ChangeListener, validates the notification channel and supported primary-key mappings, and generates an internal PostgresChangeListenerQuery annotation containing the entity reload query and the mapped key columns and property paths in query binding order.

This visitor performs compile-time processing only. It does not open a datasource connection or install PostgreSQL notification functions or triggers.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.micronaut.inject.visitor.TypeElementVisitor

    io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
     
    io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind
     
    void
    visitMethod(io.micronaut.inject.ast.MethodElement element, io.micronaut.inject.visitor.VisitorContext context)
    Validates PostgreSQL notification settings and generates the entity reload query at compilation time.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.util.Toggleable

    isEnabled

    Methods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor

    finish, getClassType, getSupportedOptions, query, start, visitClass, visitConstructor, visitEnumConstant, visitField
  • Constructor Details

    • PostgresChangeNotificationVisitor

      public PostgresChangeNotificationVisitor()
  • Method Details

    • getSupportedAnnotationNames

      public Set<String> getSupportedAnnotationNames()
      Specified by:
      getSupportedAnnotationNames in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • getElementType

      public String getElementType()
      Specified by:
      getElementType in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
    • getVisitorKind

      public io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind getVisitorKind()
      Specified by:
      getVisitorKind in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • visitMethod

      public void visitMethod(io.micronaut.inject.ast.MethodElement element, io.micronaut.inject.visitor.VisitorContext context)
      Validates PostgreSQL notification settings and generates the entity reload query at compilation time.
      Specified by:
      visitMethod in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
      Parameters:
      element - the annotated listener method
      context - the compilation visitor context used to report errors and add generated metadata