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

studio.raptor.sqlparser.fast.command.dml.ScriptCommand Maven / Gradle / Ivy

/*
 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
 * and the EPL 1.0 (http://h2database.com/html/license.html).
 * Initial Developer: H2 Group
 */
package studio.raptor.sqlparser.fast.command.dml;

import java.nio.charset.Charset;
import java.util.Collection;
import java.util.Set;
import studio.raptor.sqlparser.fast.command.CommandInterface;
import studio.raptor.sqlparser.fast.engine.Constants;
import studio.raptor.sqlparser.fast.table.Table;
import studio.raptor.sqlparser.fast.util.MathUtils;

/**
 * This class represents the statement
 * SCRIPT
 */
public class ScriptCommand extends ScriptBase {

  private Charset charset = Constants.UTF8;
  private Set schemaNames;
  private Collection tables;
  private boolean passwords;

  // true if we're generating the INSERT..VALUES statements for row values
  private boolean data;
  private boolean settings;

  // true if we're generating the DROP statements
  private boolean drop;
  private boolean simple;
  private String lineSeparatorString;
  private byte[] lineSeparator;
  private byte[] buffer;
  private boolean tempLobTableCreated;
  private int nextLobId;
  private int lobBlockSize = Constants.IO_BUFFER_SIZE;

  public ScriptCommand() {
    super();
  }


  public void setSchemaNames(Set schemaNames) {
    this.schemaNames = schemaNames;
  }

  public void setTables(Collection
tables) { this.tables = tables; } public void setData(boolean data) { this.data = data; } public void setPasswords(boolean passwords) { this.passwords = passwords; } public void setSettings(boolean settings) { this.settings = settings; } public void setLobBlockSize(long blockSize) { this.lobBlockSize = MathUtils.convertLongToInt(blockSize); } public void setDrop(boolean drop) { this.drop = drop; } public void setSimple(boolean simple) { this.simple = simple; } public void setCharset(Charset charset) { this.charset = charset; } @Override public int getType() { return CommandInterface.SCRIPT; } }