Example #1
0
  AbstractContext(Configuration configuration, PreparedStatement stmt) {
    super(configuration);
    this.stmt = stmt;

    VisitListenerProvider[] providers = configuration.visitListenerProviders();
    boolean userInternalVisitListener = false;

    this.visitListeners = new VisitListener[providers.length + (userInternalVisitListener ? 1 : 0)];

    for (int i = 0; i < providers.length; i++) this.visitListeners[i] = providers[i].provide();

    if (this.visitListeners.length > 0) {
      this.visitContext = new DefaultVisitContext();
      this.visitParts = new ArrayDeque<QueryPart>();
      this.visitClauses = new ArrayDeque<Clause>();
    } else {
      this.visitContext = null;
      this.visitParts = null;
      this.visitClauses = null;
    }

    forcedParamType =
        SettingsTools.getStatementType(settings()) == StatementType.STATIC_STATEMENT
            ? ParamType.INLINED
            : null;
  }
Example #2
0
  AbstractContext(Configuration configuration, PreparedStatement stmt) {
    super(configuration);

    this.stmt = stmt;
    this.visitClauses = new ArrayDeque<Clause>();

    VisitListenerProvider[] providers = configuration.visitListenerProviders();

    this.visitListeners = new VisitListener[providers.length + 1];
    this.visitContext = new DefaultVisitContext();
    this.visitParts = new ArrayDeque<QueryPart>();

    for (int i = 0; i < providers.length; i++) {
      this.visitListeners[i] = providers[i].provide();
    }

    this.visitListeners[providers.length] = new InternalVisitListener();
  }
Example #3
0
 @Override
 public VisitListenerProvider[] visitListenerProviders() {
   return delegate.visitListenerProviders();
 }