~mmcm/akiban-sql-parser/misc-non-akserver

« back to all changes in this revision

Viewing changes to src/main/java/com/akiban/sql/parser/AlterTableRenameColumnNode.java

  • Committer: build-akiban
  • Date: 2013-02-09 22:28:17 UTC
  • mfrom: (288.1.5 akiban-sql-parser)
  • Revision ID: build@akiban.com-20130209222817-n748ae1tl97yq9n6
merge oontvoo: Support ALTER-TABLE-RENAME-COLUMN statements, allow option <TABLE> token after ALTER-TABLE-RENAME, and transform RENAME-COLUMN to ALTER-TABLE-RENAME-COLUMN.

https://code.launchpad.net/~oontvoo/akiban-sql-parser/alter-rename-column/+merge/146574

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright © 2012 Akiban Technologies, Inc.  All rights
 
3
 * reserved.
 
4
 *
 
5
 * This program and the accompanying materials are made available
 
6
 * under the terms of the Eclipse Public License v1.0 which
 
7
 * accompanies this distribution, and is available at
 
8
 * http://www.eclipse.org/legal/epl-v10.html
 
9
 *
 
10
 * This program may also be available under different license terms.
 
11
 * For more information, see www.akiban.com or contact
 
12
 * licensing@akiban.com.
 
13
 *
 
14
 * Contributors:
 
15
 * Akiban Technologies, Inc.
 
16
 */
 
17
 
 
18
package com.akiban.sql.parser;
 
19
 
 
20
import com.akiban.sql.StandardException;
 
21
 
 
22
public class AlterTableRenameColumnNode extends TableElementNode
 
23
{
 
24
    private String oldName;     // old column name
 
25
    private String newName;     // new column name
 
26
    
 
27
    @Override
 
28
    public void init(Object oldN, Object newN)
 
29
    {
 
30
        oldName = (String) oldN;
 
31
        newName = (String) newN;
 
32
        super.init(oldName, ElementType.AT_RENAME_COLUMN);
 
33
    }
 
34
    
 
35
    @Override
 
36
    public void copyFrom(QueryTreeNode node) throws StandardException
 
37
    {
 
38
        super.copyFrom(node);
 
39
        oldName = ((AlterTableRenameColumnNode)node).oldName;
 
40
        newName = ((AlterTableRenameColumnNode)node).newName;
 
41
    }
 
42
    
 
43
    public String newName()
 
44
    {
 
45
        return newName;
 
46
    }
 
47
}