View Javadoc

1   /*
2    * joey-gen and its relative products are published under the terms
3    * of the Apache Software License.
4    * 
5    * Created on 2004/08/10 17:15:47
6    */
7   package org.asyrinx.joey.gen.model.rdb;
8   
9   import org.asyrinx.joey.gen.model.Element;
10  
11  /***
12   * @author akima
13   */
14  public class IndexEntry extends Element {
15  
16      public IndexEntry() {
17          super();
18      }
19  
20      public IndexEntry(String name) {
21          super(name);
22      }
23  
24      /***
25       *  
26       */
27      public IndexEntry(Index parent, String name) {
28          super(parent, name);
29      }
30  
31      /*
32       * (non-Javadoc)
33       * 
34       * @see org.asyrinx.joey.gen.model.Element#getParentElement()
35       */
36      public Index getParent() {
37          return (Index) super.getParentElement();
38      }
39  
40      public Column getColumn() {
41          final Index index = this.getParent();
42          if (index == null)
43              return null;
44          final Table table = index.getParent();
45          if (table == null)
46              return null;
47          return table.getColumns().getColumn(this.getName());
48      }
49  
50  }