org.apache.cayenne.velocity

## Class BindObjectEqualDirective

- java.lang.Object
- - org.apache.velocity.runtime.directive.Directive
  - - org.apache.cayenne.velocity.BindDirective
    - - org.apache.cayenne.velocity.BindObjectEqualDirective

- All Implemented Interfaces:
    Cloneable, org.apache.velocity.runtime.directive.DirectiveConstants
  Direct Known Subclasses:
    BindObjectNotEqualDirective

      public class BindObjectEqualDirective
      extends BindDirective

  A custom Velocity directive to create a set of SQL conditions to match an ObjectId of an object. Usage in Velocity template is "WHERE #bindObjectEqual($object)" or "WHERE #bindObjectEqual($object $columns $idValues)".
  Since:
    3.0

- - ### Field Summary

    - ### Fields inherited from class org.apache.velocity.runtime.directive.Directive

      `rsvc`

    - ### Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants

      `BLOCK, LINE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BindObjectEqualDirective()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()`
    `boolean` | `render(org.apache.velocity.context.InternalContextAdapter context, Writer writer, org.apache.velocity.runtime.parser.node.Node node)` Extracts the value of the object property to render and passes control to `BindDirective.render(InternalContextAdapter, Writer, ParameterBinding)` to do the actual rendering.
    `protected void` | `render(org.apache.velocity.context.InternalContextAdapter context, Writer writer, ParameterBinding binding)`
    `protected void` | `renderColumn(org.apache.velocity.context.InternalContextAdapter context, Writer writer, Object columnName, int columnIndex)`
    `protected Object[]` | `toArray(Object columns)`
    `protected Map` | `toIdMap(Object object)`

    - ### Methods inherited from class org.apache.cayenne.velocity.BindDirective

      `bind, getChild, getType, render`

    - ### Methods inherited from class org.apache.velocity.runtime.directive.Directive

      `getColumn, getLine, getTemplateName, init, setLocation, setLocation`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### BindObjectEqualDirective

          public BindObjectEqualDirective()

  - ### Method Detail

    - #### getName

          public String getName()

      Overrides:
        `getName` in class `BindDirective`

    - #### render

          public boolean render(org.apache.velocity.context.InternalContextAdapter context,
                                Writer writer,
                                org.apache.velocity.runtime.parser.node.Node node)
                         throws IOException,
                                org.apache.velocity.exception.ResourceNotFoundException,
                                org.apache.velocity.exception.ParseErrorException,
                                org.apache.velocity.exception.MethodInvocationException

      Description copied from class: `BindDirective`
      Extracts the value of the object property to render and passes control to `BindDirective.render(InternalContextAdapter, Writer, ParameterBinding)` to do the actual rendering.
      Overrides:
        `render` in class `BindDirective`
      Throws:
        `IOException`
        `org.apache.velocity.exception.ResourceNotFoundException`
        `org.apache.velocity.exception.ParseErrorException`
        `org.apache.velocity.exception.MethodInvocationException`

    - #### toArray

          protected Object[] toArray(Object columns)

    - #### toIdMap

          protected Map toIdMap(Object object)
                         throws org.apache.velocity.exception.ParseErrorException

      Throws:
        `org.apache.velocity.exception.ParseErrorException`

    - #### renderColumn

          protected void renderColumn(org.apache.velocity.context.InternalContextAdapter context,
                                      Writer writer,
                                      Object columnName,
                                      int columnIndex)
                               throws IOException

      Throws:
        `IOException`

    - #### render

          protected void render(org.apache.velocity.context.InternalContextAdapter context,
                                Writer writer,
                                ParameterBinding binding)
                         throws IOException

      Overrides:
        `render` in class `BindDirective`
      Throws:
        `IOException`

Copyright © 2001–2018 Apache Cayenne. All rights reserved.