/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.shardingsphere.core.parsing.parser.token;

import lombok.Getter;
import lombok.ToString;
import org.apache.shardingsphere.core.util.SQLUtil;

/**
 * Encrypt column token.
 *
 * @author panjuan
 */
@ToString
public final class EncryptColumnToken extends SQLToken {
    
    @Getter
    private final int stopIndex;
    
    private final String tableName;
    
    public EncryptColumnToken(final int startIndex, final int stopIndex, final String tableName) {
        super(startIndex);
        this.stopIndex = stopIndex;
        this.tableName = tableName;
    }
    
    /**
     * Get table name.
     *
     * @return table name
     */
    public String getTableName() {
        return SQLUtil.getExactlyValue(tableName);
    }
}

@@ -946,20 +946,47 @@
 ore.
-util.SQLUtil
+parsing.parser.context.condition.Column
 ;%0A%0A/
@@ -1043,18 +1043,8 @@
  */%0A
-@ToString%0A
 publ
@@ -1169,31 +1169,70 @@
 e final 
-String tableNam
+Column column;%0A    %0A    private final boolean isInWher
 e;%0A    %0A
@@ -1314,23 +1314,45 @@
 nal 
-String tableNam
+Column column, final boolean isInWher
 e) %7B
@@ -1432,198 +1432,59 @@
 his.
-tableName = tableName
+column = column
 ;%0A    
-%7D%0A
     
-%0A    /**%0A     * Get table name.%0A     *%0A     * @return table name%0A     */%0A    public String getTableName() %7B%0A        return SQLUtil.getExactlyValue(tableName)
+this.isInWhere = isInWhere
 ;%0A  

modify EncryptColumnToken