# Class Context

java.lang.Object
org.apache.cayenne.access.translator.sqltemplate.Context

public class Context extends Object

Since:
  4.1

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Context(Map<String, Directive> directives, Map<String,?> parameters, boolean positionalMode, DbAdapter adapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addColumnDescriptor(RSColumn descriptor)`
  `void`
  `addParameterBinding(int jdbcType, int scale, Object value)`
  `String`
  `buildTemplate()`
  `StringBuilder`
  `getBuilder()`
  `RSColumn[]`
  `getColumnDescriptors()`
  `Directive`
  `getDirective(String name)`
  `ExtendedType<?>`
  `getExtendedType(String javaClassName)`
  Resolves the `ExtendedType` for the given Java class name via the target adapter.
  `Object`
  `getObject(String name)`
  `PSParameter[]`
  `getParameterBindings()`
  `boolean`
  `haveObject(String name)`
  `int`
  `preferredBindingType(int jdbcType)`
  Returns the JDBC type the target adapter prefers for binding the given type.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### Context

    public Context(Map<String, Directive> directives, Map<String,?> parameters, boolean positionalMode, DbAdapter adapter)

- ## Method Details

  - ### preferredBindingType

    public int preferredBindingType(int jdbcType)
    Returns the JDBC type the target adapter prefers for binding the given type.
    Since:
      5.0

  - ### getExtendedType

    public ExtendedType<?> getExtendedType(String javaClassName)
    Resolves the `ExtendedType` for the given Java class name via the target adapter. A null class name resolves to the adapter's default type.
    Since:
      5.0

  - ### getDirective

    public Directive getDirective(String name)

  - ### getBuilder

    public StringBuilder getBuilder()

  - ### buildTemplate

    public String buildTemplate()

  - ### haveObject

    public boolean haveObject(String name)

  - ### getObject

    public Object getObject(String name)

  - ### addParameterBinding

    public void addParameterBinding(int jdbcType, int scale, Object value)

  - ### addColumnDescriptor

    public void addColumnDescriptor(RSColumn descriptor)

  - ### getColumnDescriptors

    public RSColumn[] getColumnDescriptors()

  - ### getParameterBindings

    public PSParameter[] getParameterBindings()