package suricatta.impl;

import org.jooq.impl.DefaultDataType;
import org.jooq.conf.ParamType;
import org.jooq.RenderContext;
import org.jooq.BindContext;
import org.jooq.Context;
import org.jooq.DataType;
import org.jooq.Param;

import static org.jooq.conf.ParamType.INDEXED;
import static org.jooq.conf.ParamType.INLINED;


@SuppressWarnings({"unchecked", "deprecation"})
public class ParamWrapper extends org.jooq.impl.CustomField
  implements Param {

  private final IParam adapter;
  private boolean inline;
  private Object value;

  public ParamWrapper(final IParam adapter, final Object value) {
    super(null, DefaultDataType.getDefaultDataType("__suricatta_other"));
    this.adapter = adapter;
    this.value = value;
    this.inline = false;
  }

  @Override
  public Object getValue() {
    return value;
  }

  @Override
  public String getParamName() {
    return null;
  }

  @Override
  public final ParamType getParamType() {
    return inline ? INLINED: INDEXED;
  }

  @Override
  public void setValue(final Object val) {
    this.setConverted(val);
  }

  @Override
  public void setConverted(final Object val) {
    this.value = getDataType().convert(val);
  }

  @Override
  public void setInline(final boolean inline) {
    this.inline = inline;
  }

  @Override
  public boolean isInline() {
    return this.inline;
  }

  @Override
  public void accept(Context ctx) {
    if (ctx instanceof RenderContext) {
      this.adapter.render(this.value, (RenderContext) ctx);
    } else {
      this.adapter.bind(this.value, (BindContext) ctx);
    }
  }
}



@@ -221,16 +221,43 @@
 q.Param;
+%0Aimport org.jooq.ParamMode;
 %0A%0Aimport
@@ -773,32 +773,110 @@
 e = false;%0A  %7D%0A%0A
+  @Override%0A  public ParamMode getParamMode() %7B%0A    return ParamMode.IN;%0A  %7D%0A%0A
   @Override%0A  pu

Fix compatibility issue with jOOQ 3.9.0.