package com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.postgresql;

import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGInsertStatement;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.Condition.BinaryOperator;
import com.google.common.base.Optional;

/**
 * 
 * @author zhangdachuan
 *
 */

public class PostgreSQLInsertVisitor extends AbstractPostgreSQLVisitor {

	@Override
	public boolean visit(final PGInsertStatement x) {
		getParseContext().setCurrentTable(x.getTableName().toString(), Optional.fromNullable(x.getAlias()));
		for (int i = 0; i < x.getColumns().size(); i++) {
			getParseContext().addCondition(x.getColumns().get(i).toString(), x.getTableName().toString(),
					BinaryOperator.EQUAL, x.getValues().getValues().get(i), getDatabaseType(), getParameters());
		}
		return super.visit(x);
	}
}

@@ -305,19 +305,27 @@
 gdachuan
+ 
 %0A *
+%E6%8F%92%E5%85%A5%E6%95%B0%E6%8D%AE %E5%A4%84%E7%90%86
 %0A */%0A%0Apu

Update PostgreSQLInsertVisitor.java