/* Generated By:JJTree: Do not edit this line. OLikeOperator.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.orientechnologies.orient.core.sql.parser;

import com.orientechnologies.common.collection.OMultiValue;
import com.orientechnologies.orient.core.query.OQueryHelper;

public class OLikeOperator extends SimpleNode implements OBinaryCompareOperator {
  public OLikeOperator(int id) {
    super(id);
  }

  public OLikeOperator(OrientSql p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(OrientSqlVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }

  @Override
  public boolean execute(Object iLeft, Object iRight) {
    if (OMultiValue.isMultiValue(iLeft) || OMultiValue.isMultiValue(iRight))
      return false;

    return OQueryHelper.like(iLeft.toString(), iRight.toString());
  }

  @Override
  public String toString() {
    return "LIKE";
  }

  @Override public boolean supportsBasicCalculation() {
    return true;
  }

  @Override public OLikeOperator copy() {
    return new OLikeOperator(-1);
  }

  @Override public boolean equals(Object obj) {
    return obj != null && obj.getClass().equals(this.getClass());
  }

  @Override public int hashCode() {
    return getClass().hashCode();
  }
}
/* JavaCC - OriginalChecksum=16d302abf0f85b404e57b964606952ca (do not edit this line) */

@@ -624,16 +624,21 @@
 %7D%0A%0A  /**
+%0A   *
  Accept 
@@ -649,16 +649,19 @@
 visitor.
+%0A  
  **/%0A  p
@@ -933,16 +933,85 @@
 false;%0A%0A
+    if (iLeft == null %7C%7C iRight == null) %7B%0A      return false;%0A    %7D%0A
     retu
@@ -1142,32 +1142,34 @@
   %7D%0A%0A  @Override
+%0A 
  public boolean 
@@ -1222,32 +1222,34 @@
   %7D%0A%0A  @Override
+%0A 
  public OLikeOpe
@@ -1305,32 +1305,34 @@
   %7D%0A%0A  @Override
+%0A 
  public boolean 
@@ -1434,16 +1434,18 @@
 Override
+%0A 
  public 

Fix NPE on LIKE operator (SQL)