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/11/08 14:53:31
6    */
7   package org.asyrinx.joey.gen.command.rdb;
8   
9   import java.util.Iterator;
10  
11  import org.asyrinx.joey.gen.model.rdb.Column;
12  import org.asyrinx.joey.gen.model.rdb.PrimaryKeyEntry;
13  import org.asyrinx.joey.gen.model.rdb.Table;
14  
15  /***
16   * @author takeshi
17   */
18  public class PreparePrimaryKey extends RdbCommand {
19  
20      /***
21       *  
22       */
23      public PreparePrimaryKey() {
24          super();
25      }
26  
27      /*
28       * (non-Javadoc)
29       * 
30       * @see org.asyrinx.joey.gen.model.rdb.visitor.RdbVisitorMock#visit(org.asyrinx.joey.gen.model.rdb.Table)
31       */
32      public void visit(Table table) {
33          for (Iterator i = table.getColumns().iterator(); i.hasNext();) {
34              final Column column = (Column) i.next();
35              if (column.isPrimaryKey())
36                  new PrimaryKeyEntry(table.getPrimaryKey(), column);
37          }
38      }
39  }