All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.couchbase.client.java.query.dsl.path.DefaultMergeKeyClausePath Maven / Gradle / Ivy

There is a newer version: 3.7.7
Show newest version
package com.couchbase.client.java.query.dsl.path;

import com.couchbase.client.java.query.dsl.Expression;
import com.couchbase.client.java.query.dsl.element.Element;

import static com.couchbase.client.java.query.dsl.Expression.x;

/**
 * .
 *
 * @author Michael Nitschinger
 */
public class DefaultMergeKeyClausePath extends AbstractPath implements MergeKeyClausePath {

  public DefaultMergeKeyClausePath(AbstractPath parent) {
    super(parent);
  }

  @Override
  public MergeUpdatePath onKey(final Expression expression) {
    element(new Element() {
      @Override
      public String export() {
        return "ON KEY " + expression.toString();
      }
    });
    return new DefaultMergeUpdatePath(this);
  }

  @Override
  public MergeUpdatePath onPrimaryKey(final Expression expression) {
    element(new Element() {
      @Override
      public String export() {
        return "ON PRIMARY KEY " + expression.toString();
      }
    });
    return new DefaultMergeUpdatePath(this);
  }

  @Override
  public MergeUpdatePath onKey(String expression) {
    return onKey(x(expression));
  }

  @Override
  public MergeUpdatePath onPrimaryKey(String expression) {
    return onPrimaryKey(x(expression));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy