/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.camunda.bpm.engine.cassandra.provider;

import com.datastax.driver.core.Session;

public class VariableTypeHandler implements TypeHandler {

  public final static String TYPE_NAME = "variable";

  public final static String CREATE_TYPE_STATEMENT = "CREATE TYPE IF NOT EXISTS " + TYPE_NAME + " ("
  + "id_ text,"
  + "rev_ int,"
  + "type_ text,"
  + "name_ text,"
  + "execution_id_ text,"
  + "proc_inst_id_ text,"
  + "case_execution_id_ text,"
  + "case_inst_id_ text,"
  + "task_id_ text,"
  + "bytearray_id_ text,"
  + "double_ double,"
  + "long_ bigint,"
  + "text_ text,"
  + "text2_ text,"
  + "var_scope_ text,"
  + "sequence_counter_ int,"
  + "is_concurrent_local_ boolean"
  + ");";

  public final static String DROP_TYPE_STATEMENT = "DROP TYPE IF EXISTS " + TYPE_NAME + ";";


  public void createType(Session s) {
    s.execute(CREATE_TYPE_STATEMENT);
  }

  public void dropType(Session s) {
    s.execute(DROP_TYPE_STATEMENT);
  }

}

add variable type handler