~nwilliams/akiban-sql-parser/rm-empty-resources-dir

« back to all changes in this revision

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

  • Committer: build-akiban
  • Date: 2013-03-07 22:02:37 UTC
  • mfrom: (290.1.2 akiban-sql-parser)
  • Revision ID: build@akiban.com-20130307220237-tmvrrh36yh0jgdul
merge tjoneslo: Fix for bug 1152175 and 1053091 -

https://code.launchpad.net/~tjoneslo/akiban-sql-parser/fix-bug-1053091/+merge/152217

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import com.akiban.sql.StandardException;
21
21
import com.akiban.sql.parser.JoinNode.JoinType;
22
22
 
23
 
public class IndexConstraintDefinitionNode extends ConstraintDefinitionNode
 
23
public class IndexConstraintDefinitionNode extends ConstraintDefinitionNode implements IndexDefinition
24
24
{
25
25
    private String indexName;
26
26
    private IndexColumnList indexColumnList;
36
36
    {
37
37
        super.init(tableName,
38
38
                   ConstraintType.INDEX,
39
 
                   null, // properties : don't need
40
39
                   null, // column list? don't need. Use indexColumnList instead
41
 
                   null, // constrainText ? 
42
 
                   null, // conditionCheck ?
 
40
                   null, // properties - none
 
41
                   null, // constrainText  - none
 
42
                   null, // conditionCheck  - none
43
43
                   StatementType.UNKNOWN, // behaviour? 
44
44
                   ConstraintType.INDEX);
45
45
        
58
58
    {
59
59
        return indexColumnList;
60
60
    }
61
 
    
 
61
 
62
62
    public JoinType getJoinType()
63
63
    {
64
64
        return joinType;
69
69
        return location;
70
70
    }
71
71
    
 
72
    // This is used for the non-unique "INDEX" defintions only
 
73
    public boolean getUniqueness() 
 
74
    {
 
75
        return false;
 
76
    }
 
77
    
 
78
    public TableName getObjectName()
 
79
    {
 
80
        return constraintName;
 
81
    }
 
82
    
72
83
    @Override
73
84
    public void copyFrom(QueryTreeNode node) throws StandardException
74
85
    {
86
97
    {
87
98
        return super.toString()
88
99
                + "\nindexName: " + indexName
89
 
                + "\nindexColumnList: " + indexColumnList
90
100
                + "\njoinType: " + joinType
91
101
                + "\nlocation: " + location
92
102
                ;
93
103
    }
 
104
 
 
105
    @Override
 
106
    public void printSubNodes(int depth) {
 
107
        super.printSubNodes(depth);
 
108
        if (indexColumnList != null) {
 
109
            printLabel(depth, "indexColumnList: ");
 
110
            indexColumnList.treePrint(depth + 1);
 
111
        }
 
112
    }
 
113
    
94
114
}