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/10/26 15:58:51
6    */
7   package org.asyrinx.joey.gen.command.rdb;
8   
9   import org.asyrinx.joey.gen.model.rdb.Column;
10  import org.asyrinx.joey.gen.model.rdb.IndexEntry;
11  import org.asyrinx.joey.gen.model.rdb.Table;
12  import org.asyrinx.joey.gen.model.rdb.Unique;
13  
14  /***
15   * @author takeshi
16   */
17  public class PrepareColumnUnique extends RdbCommand {
18  
19      public void visit(Column column) {
20          if (!column.isUnique())
21              return;
22          final Table table = column.getParent();
23          final Unique unique = new Unique(table);
24          new IndexEntry(unique, column.getName());
25          this.log(unique, "create UNIQUE from " + column.getFullName());
26      }
27  
28  }