package suricatta.impl;

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


@SuppressWarnings("unchecked")
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 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);
    }
  }
}



@@ -48,32 +48,64 @@
 efaultDataType;%0A
+import org.jooq.conf.ParamType;%0A
 import org.jooq.
@@ -223,16 +223,111 @@
 Param;%0A%0A
+import static org.jooq.conf.ParamType.INDEXED;%0Aimport static org.jooq.conf.ParamType.INLINED;%0A%0A
 %0A@Suppre
@@ -337,16 +337,17 @@
 arnings(
+%7B
 %22uncheck
@@ -349,16 +349,32 @@
 checked%22
+, %22deprecation%22%7D
 )%0Apublic
@@ -881,24 +881,121 @@
  null;%0A  %7D%0A%0A
+  @Override%0A  public final ParamType getParamType() %7B%0A    return inline ? INLINED: INDEXED;%0A  %7D%0A%0A
   @Override%0A

Add missing methods on ParamWrapper.